Trowl – Rage (Power-Up)

This week I have been working on one of the power-ups in our game, Rage. This power-up allows the player to move around a lot faster, the player does not take damage, all enemies that comes in contact with the player while in this state are eliminated and in addition to this the player yeild twice as much points from killing enemies with this power-up. The Rage power-up has a duration of 10 seconds and after that the player goes back to its normal state.

To visualize that the player has picked up the Rage power-up, the player is surrounded by flames. Here is a picture of how it looks like:

Rageblogg

While the power-up is active the player is invulnerable like I mentioned before. However, the owlets which follows the player is still vulnerable to enemy attacks.Owlets that are hit by enemies increase stress by twice as much as when the player is hit, stress represents the players health. Therefore the player still needs to be cautious while in this state.

I implemented this power-up into the game by creating a new class which I called Rage. This class stored the sprite, the texture of the power-up and the collision box for the sprite. Here is the sprite and the icon that represents the Rage power-up:

rage

When the player collides with this sprite the power-up is activated instantly.

After the power-up icon was implemented all I had to do was increase the players speed and make the player immune to damage after colliding with this sprite. I increased the players speed by increasing a friction value to 1,5 which normally is set to 1. The friction value is a float variable that is used in a function that regulates the players mobility. This function takes speed * friction * delta, (delta is a float variable of frames/second). So by increasing the friction value the speed and mobility gets higher.

The next step was to change a bit in our programs collision code, where the player collides with enemies and takes damage. Here I declared s function for each enemy type that when the player has a active rage power-up,the collision between the player and the enemy no longer increases stress, but instead all enemies that are hit will instantaneously perish.

I thought this task would be a hard one since I have never done something like this before, but it was actually much easier then thought. I am quite satisfied with how it turned out in the game and it works like we imagined it to.

Leave a comment