Tuesday, January 5, 2010

Weapons Upgrade

Rewriting the weapons system tonight to be more versatile, compact, and modular. Bubble sprites were being loaded in the level class, while the player and enemy classes had code for input, firing and updating...which worked, but was scattered at best.

Weapons are now built with a number of variables (rate of fire, ammo, and barrel location) which makes it easier to mix and match weapon types and projectiles.

The plan is to totally rework the 'weapon' class which had been stripped pretty bare from the last rework. Also the creation of a new 'ammo' class and a couple of new enums to handle the rate of fire and ammo type possibilities.

I still have some wonkiness going on with the per pixel collision detection on animated sprites but that's not surprising since it originated from a tutorial on static sprites. The collision fix comes at a later date.

No comments: