Game Development Reference
In-Depth Information
Implementing Powerups
Game would become more strategic if there were ways to repair your damaged tank, boost
it's speed or increase rate of fire by picking up various powerups. This should not be too
difficult to implement. We will use some of these images :
Powerups
For now, there will be four kinds of powerups:
1.
Repair damage. Wrench badge will restore damaged tank's health back to 100
when picked up.
2.
Health boost. Green +1 badge will add 25 health, up to 200 total, if you keep
picking them up.
3.
Fire boost. Double bullet badge will increase reload speed by 25%, up to 200% if
you keep picking them up.
4.
Speed boost. Airplane badge will increase movement speed by 10%, up to 150% if
you keep picking them up
These powerups will be placed randomly around the map, and will automatically respawn
30 seconds after pickup.
Implementing Base Powerup
Before rushing forward to implement this, we have to do some research and think how
to elegantly integrate this into the whole game. First, let's agree that Powerup is a
GameObject . It will have graphics, sounds and it's coordinates. Effects can by applied by
harnessing GameObject#on_collision - when Tank collides with Powerup , it gets
it.
11-powerups/entities/powerups/powerup.rb
Search WWH ::




Custom Search