Posts Tagged ‘maths’

I’m in! :D

Posted by
Thursday, August 18th, 2016 8:44 pm

count_me_in 3x

This will be my second Ludum Dare! 😀 Long time since 1st one, I missed it a lot! ^_^

This is my first time soloing so I’ll try going for the compo, but probably will end making the jam route (that is if I get to finish at all XD)

I’ll make a 2D game (I love big pixels ^_^) but apart from that I’m not planning anything else, I’ll wait for the theme and let’s see what kind of game I can imagine! 😀

I’ll be using:
-Engine: GameMaker: Studio (tought I’ll probably use notepad++ for code)
-Graphics: Aseprite (maybe also Gimp and/or Photoshop)
-Sounds: Bfxr + Audacity
-Music: FamiTracker and/or MuLab (+Audacity), maybe I’ll use some automatic generated music from as a base. This will be my first try making music, so maybe I’ll end just using royalty free chiptunes XD
-Recording/video editing (for timelapse): CamStudioPortable + VirtualdubMod
-Version control: Git + BitBucket

It’s a pity that LD ratings won’t work as usual for this LD, but there is no problem without a solution, so I think I will also join the Itch Dare ( ) to be able to rate games and so :)

Everybody, good luck and let’s have fun!! 😀

How to draw a Perfect Octagon!

Posted by (twitter: @theupgradezone)
Tuesday, November 11th, 2014 4:45 am

I did some maths while I was bored, and I calculated a way to draw a perfect octagon.
I thought this might come in useful for some of you :3

Warning! Maths ahead!



Imagine a square, with side length a.


Our octagon will fit in this square.

We will call the length of a side of the octagon b.



Now you put a into this equation:


Which can also be written as:


And you get b.

Now, round b to the nearest number. We can’t be dealing with fractions of pixels now, can we?

Now you have b, we can draw the octagon.



For this example, our reference point will be in the center of the octagon, which is also the center of our imaginary square.


Our first 2 co-ordinates will be a/2 up and b/2 to either side.



For the sides, it will be a/2 to the side and b/2 up or down.


Then, draw lines between the co-ordinates to finish the octagon.


And there you have a regular octagon!


Pseudo code:


size = (length of side of square)
oct_side = round((size*sqrt(2))/(2+sqrt(2)))


coord_1x = x – oct_side/2
coord_1y = y + size/2
coord_2x = x + oct_side/2
coord_2y = y + size/2
coord_3x = x + size/2
coord_3y = y + oct_side/2
coord_4x = x + size/2
coord_4y = y – oct_side/2
coord_5x = x + oct_side/2
coord_5y = y – size/2
coord_6x = x – oct_side/2
coord_6y = y – size/2
coord_7x = x – size/2
coord_7y = y – oct_side/2
coord_8x = x – size/2
coord_8y = y + oct_side/2





And that’s how to draw a perfect octagon!

Coming soon: How to draw a perfect hexagon!


To those interested in the maths involved to get the equation:



I originally calculated this to be able to draw the Aperture Science logo by hand, but I also saw the use of it on the computer!

[cache: storing page]