Skip to content

Mon, Aug 27, 2018

Ryan Shee edited this page Aug 30, 2018 · 9 revisions

box2d

I uploaded the initial build a couple of days ago, which was basically min-shmup(rip) + Box2D. Box2D had an initial learning curve which was a bit tough to deal with. I spent a couple hours watching tutorials from channels like Brent Aureli and Connor Anderson and reading pages like LibGDX.info and libGDX's documentation, which actually helped a ton getting my Box2D world set up. After following their tutorials and realizing the HUD uses its own viewport (before it was sharing the viewport with the game world), I had an improved min-shmup.

The main reason I worked on Box2D was because I wanted to have Box2DLights, which required Box2D. Since min-shmup didn't have a desktop build and was already in hiatus for basically a third of a year, I decided to start a new, updated project, with parts of min-shmup's corpse.

I spent a lot of time making sure the Bullet, Player, and Enemy classes all extended from a super class, leaving as little room for extraneous space as possible. I also spent a good chunk of time tracing the game loop, making sure objects and data were disposed, freed, or called exactly when it was needed only. That meant moving method calls around and even outright deleting lines. As a result, I think I've improved readability and streamlined the classes a bit.

dev

I also wrote a ton of helper classes and functions for the main objects. For example, most update functions now call other helper methods, so the update loop is easier to read. Should the reader want to know exactly what is going on, they can simple go to its implementation. Otherwise, the update function reads almost like pseudocode.

Finally, I spent a couple hours at the end of today, before writing this dev blog, writing Javadocs and clarifying comments for every file so far. One of the things I like doing is documenting my code, although I don't do it as often as I should.

The upcoming days I'll probably spend writing logic for the enemies. However, I need to get back into Unity, since GMTK's game jam is happening this weekend.

Clone this wiki locally