Last Signal – Player Power Ups.

So this week I have been working on implementing the power ups the player while be able to pick up from the world. This was an important feature we needed to have for our presentation of the alpha version of our game.

The Power ups works whit our Room system that then draws them into our world for the player to collect. The room system is described in better detail at (http://antonclasson.com/2015/02/19/last-signal-room-system/). But described in a few words it would be a text file whit x and y coordinates and other data. The data is the read and drawn into our world. The Power ups are also located in this text document. Whit their own coordinates and power up type.

The different types of power ups is Damage field which allows the player to become invulnerable and damage enemies if a collision occurs. CPR (Compressed Plasma Rounds) that have a higher base damage the players ordinary projectiles. Battery pack that refills the players energy, And Lastly for the alpha build the Repair kit that repairs the player to full health.

All these power ups then get their own colliders that applies an effect to the player depending on the type of power up the player collides whit. As an example the power up damage field sets a invulnerable true/false variable to true. That makes it so the player can’t take damage as long as it’s true. This also triggers a timer to count down. And when this timer reaches zero the invulnerable variable is set to false and also the timer resets. While this timer is counting down the player also gets a new sprite to represent the field that surrounds the player. This is so the player gets a visual representation for the power up. When the timer reaches zero the sprite change back into the original astronaut sprite that was used in the beginning.

picture before

So the one above is the one before pick up the one whit a lightning bolt is the battery pack and the plain one is the Damage field. And Below you will see the Damage field power up in effect.

picture after
When a collision occurs between the player and any power up the power up is then removed from the list of power ups so it disappears in the game. This is the description of a type o power up but the other types work in very similar fashion it applies an effect to the player on collision be it temporary invulnerability or just increasing health to Max. It then disappears from the world and can’t be used again.

The only power up yet not implemented is the Overcharge that gives the player faster fire rate. That sad to say is yet to be implemented as it required some changes to the player class that we didn’t have time to do. But it is not that hard and will be in the game before the beta.

About Axel Palmqvist-Gillman

2014  Programming