Game Development Reference
In-Depth Information
class ObjectPool
# ...
attr_accessor :powerup_respawn_queue
# ...
def update_all
# ...
@powerup_respawn_queue . respawn( self )
end
# ...
end
This is it, the game should now contain randomly placed powerups that respawn 30 seconds
after picked up. Time to enjoy the result.
Playing with powerups
We haven't done any changes to AI though, that means enemies will only be picking those
powerups by accident, so now you have a significant advantage and the game has suddenly
became too easy to play. Don't worry, we will be fixing that when overhauling the AI.
Search WWH ::




Custom Search