Blaster-Mines Chronicles #2
I have spent the last couple nights’ worth of late-night game
programming to make a little more progress with Blaster-Mines. I used
up an inordinate amount of time coming up with a class structure for
the Enemy types. The first enemy I created was the ‘Wanderer’ as
seen in my last post. I used this as a guide to create a simple
class structure for all enemy types. I started with a
BasicArrayBlitObject class that had all of the basic attributes for a
movable screen blit object. It used an an array to hold the frames of
rotated animation. I thought this would be the best way to go about
it and figured that all of my future Enemy could just inherit from
the this class. I was wrong.
I needed to create a ‘Mine’ as the next step in coding the
game. The ‘Mine’ is actually more akin to a ‘Base’ and is
made up of at least 3 parts (so far). The Mine has a Housing:
is by no means the final version of the first Mine types Housing, but
it is a start. The Housing cannot be destroyed (for this Mine, but I
plan on destructible Housing for another type). Inside the corridor
through the center of the Housing sits the actual Mine. Blocking the
corridor will be left and right blast doors that will need to be
destroyed (in this type). Here is the tile sheet for those so far:
The first 4 frames are the mine so far. It loops through those
colors repeatedly for a sort of glowing target. The next 8 frames are
the left and right doors, consisting of 3 green horizontal lines that
can ‘open’ or be destroyed in order. I might have them be
indestructible and open periodically, but I haven’t decided yet.
So, above I mentioned that I had created the BasicArrayBlitObject
as the base class for all enemy, but that was before I decided to
make a tilesheet for the mine. Now I needed a BasicTileSheetBlit
class and a TileSheet class to boot. I played around with using an
interface and multiple discarded methods of using one base Enemy
class for both the Wanderers and the Mines, but it was a fruitless
effort. So, I am still using both my BasicArrayBlitObject and my
BasicTilesheetBlitObject, but they are not the base classes for Enemy
objects. Instead, I have a BasicEnemy class and a BasicMine class
and both use Composition rather than inheritance to make use of the
Basic blit classes where necessary.
Anyway, not to bore any longer with the nutty details, here is a
screen shot of the game in action with this first Mine in place.
Notice I haven’t coded the doors yet.