Tuesday, April 29, 2014

My week back in Java Post #15

This past week I spent 3 days working with the Parts & Portals game group.  Well...  really just Daniel and myself.  We had a fairly successful run of it.  We got the enemy units turning and jumping and the player shooting bullets and a little health powerup working.

The AndEngine has some interesting quirks and I didn't spend enough time to really get a good feel for it but the bullets took us a while to implement because of the way the engine handles dynamic object spawning.  The AndEngine requires dynamic object spawning be handled by a GenericPool class that the given subclass must extend.  This is because the small amount of phone RAM must be tightly controlled.  Java's regular garbage collection doesn't seem to cut it so it looks like the GenericPool class takes care of object loading from level to level.

If you don't want to use the GenericPool it seems like the only other option is to use the XML level editor to hard-code assets into the level.  This works out great for health and powerups but doesn't work for dynamic badguys and bullets.   It took us a few hours to figure all of this out but once we defined the two basic datatypes for the engine the rest of the work went pretty smooth.

Moving forward, once collision detection for bullets is in place, killing enemies should be a snap as the superclass already "knows how to die".  Which will bring the game to a point where you are being chased by enemies that can kill you and that you can kill (plus there's life!).

Overall we had a pretty good time getting over their engine hump and we will spend this next week getting me over my HTML5/CSS3 hump.

Thanks for reading,
-Clay

No comments:

Post a Comment