Freeze Gun

Added the first gun socket tonight, which is the freeze gun.  First of all, a freeze variable was added to the enemy.  I represented this as an integer, which is zero if the enemy is not frozen.  When the enemy is frozen, then that variable is set to the number of frames that the freeze will last.  On each enemy update, the freeze value is decremented if it is greater than zero.

I added a method that returns true if the frozen value is positive.  This is used in the GameScreen class to determine if the enemy should be drawn frozen.  For now, if an enemy is frozen then it is drawn with a blue shade.  In the EquippedSockets class, I created a method to flip the zero gun socket between None and Ice when the confirm button is pressed when the gun is selected.  I’m starting to think about removing the two gun (zero and one) concept from the game, because it may make the game too complex with the socket system.

The projectile class was also updated to include a boolean to indicate if the pellet has the ice attribute.  If the ice gun socket is equipped and the gun is shot, then the ice boolean for the projectile gets set to true.  I created a simple diamond shape in Gimp to represent the ice projectile.  I’ll work on the graphics later, but this will at least let me know if the ice projectile is correctly shooting.

I’m going to leave it at that tonight.  Sorry, no videos this time.  I think I’ll hold off on those until I have something a little more impressive to show.  The ice gun functions correctly and properly freezes enemies, but one change I may make is the ability to land on enemies that are frozen, so they can be used as stepping stones.  Currently, frozen enemies will still hurt the player.

One Reply to “Freeze Gun”

Comments are closed.