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.

Trowl – HardWinds

This week I have been working on serveral different tasks. Amongst these were: Owlet duplication and movement, two different enemy-type classes (Eagle and Hawk) and finally Hard winds. I have choosen to describe more thoroughly is how I implemented Hard winds into the game.

Hard winds is one of our obstacles in  Trowl. If the player enters these hardwinds the player movement is slowed down for a couple of seconds causing him and the owlets to become more vulnerable to enemy attacks.

HardWindsblogg

This is how hard winds look like in the game. Luckily the sprite which represents hardwinds is just a temporary one that I have created and will not be in the final version of the game.

Functions and calculations

To make this obstacle I created a new class with no special functions except the one function that makes the sprite appear in the game every 30 seconds. I declared this function in the Hard winds class update function which counts frames/second.  The function includes three float variables: one for elapsed time,  one for duration and one for frames/second. Elapsed time is in this case equal to frames/second and duration is a constant variable which I have set to  30. When elapsed time is equal with duration the hard winds sprite loads into the game. So, from the point when the player starts the game the counting of frames/second starts until it reaches 30 and the hard winds event is initialized. The duration of the event is 10 seconds and to do this I created a function that takes elapsed time subtracted with duration when 10 seconds have surpassed the 30 second mark.These are the complete list of functions:

  • [ElapsedTime += Frames/Second] (Just to count seconds in the game)
  • [ElapsedTime >= Duration] (When this occurs, hardwinds event initializes)
  • [ElapsedTime >= Duration + 10](Event duration is 10 seconds and when 10 seconds surpasses the duration, hardwinds event stops.)

Besides these calculations the hard winds class is basically just a big collision box that checks collision with the player. When the player collides with hardwinds the friction value of the player is increased. The friction value regulates the players speed and mobility and therefore kind of creates the sensation of flying in hard winds.

This obstacle was implemented in the game to create a more interesting gameplay and challenge the player by making positioning a more vital part of the gameplay. At least two other obstacles will be implemented but this is the first one that will be shown in our Alpha.

 

Trowl – Owlets

Owlets are one of the core elements in the game we are creating called Trowl where the protagonist is an owl mother. As the game starts the player’s goal is to pick up and lead these owlets to the end of each level. The players primary concern when having picked up the owlets is to keep them safe and out of reach from enemy attacks. Each owlet that the player successfully protects through the level will give a slight bonus to the final score. The owlets also have a impact on the players “health” or in this case the amount of stress the owl mother is afflicted by. When picked up the owlets reduce the amount of stress by 20%, but they also increase the amount of stress with 20% if hit by enemies. The player therefore benefit from picking up the owlets and keeping them out of harm.

But the true challenge is to protect the owlets as they player pick up more of them since they pile up behind the player in a snake like form. The formation could look like this.Owlet, Blogg.png

It becomes very apparent that the game play difficulty increases when owlets are being picked up since the player grows longer and more vulnerable to enemy attacks. This creates a more interesting and challenging game play.

To program this kind of snake-like movement was quite hard since I recently started programming and lack some experience. The easy part was to create the event were the owl mother collides with the owlet and to change their new position behind the owl mother. But at this point they were only following the owl mother in a straight and very stale line, which obviously was not what we were after. The difficult part was to create the snake-like movement pattern for the owlets. To be honest I have yet to figure out how to solve this problem, but I think I have a clue of how to do it.

Each owlet need their own position behind the owl mother and each owlet have to adapt their speed and position depending on the speed and position of the object in front. I will also need to create some sort of speed delay for the owlet’s when moving behind each other to simulate this snake-like movement pattern. Otherwise if all objects were traveling at the same speed it would cause the same stale straight line, which we do not want.

At least I have an idea of how to solve this issue, and I am most certain that I will finish this movement pattern in no time!