2013/12/18

miniDooM: And There was Motion (and Polygons!)

So I finally decided to stop stalling and got around to installing and using some screencast capture software on Ubuntu. Here's the result:


Now for the analysis:

2013/12/17

miniDooM: Intersecting...

Will you look at that? Turns out the largely untested intersection-detection code I had written is actually working! Must be my birthday...


Yes, that red line is the green Doomie "shooting", and yes, that square is indeed rotating and the intersections update properly... I really need to get on to recording animated gifs of these updates...

miniDooM: More Polygons

So I fixed the issue with the edges not rotating properly. The problem was... that I wasn't using the proper method (of the ones I programmed myself), so yeah, a bit silly, but, on the bright side, I got to test that other method too!

I've also realized why the polygons kept growing as I added more sides, and, again, it was a case of the algorithm working properly and me not using it correctly.

The thing is that, in order to create regular polygons, I would calculate the radius (distance from the center to a vertex) based on the side length, the formula being:

radius = sideLength / ( 2 * Sin ( 180 / numberOfSides ) )

Which means that, for a constant side length (as was the case in my tests), the radius will change as the number of sides changes.

So I've added a method that accepts a fixed polygon radius rather than side length, and here's the result:




For those who care to know:

Polygon2d( Point2d center, double radius, int edgeCount )

Oh, and yes, they are all rotating.


Incidentally, I need to rework that hexagon grid floor, it pops way too much for a floor texture.

2013/12/13

miniDooM: A Wild Triangle Has Appeared!

I really shouldn't try Pokemon jokes, I've never really played the games...

In any case, here's a tiny little update:


What are you seeing here? Well, let's see: