Trowl – Thunder
|
This week I have been working on one of our obstacles in the game. This obstacle is a thunderstorm that occurs at certain occasions as the game proceed. The thunderstorm event takes place on the top of the screen and covers an area that is 1920 pixels wide and 300 pixels tall. Here is a picture of how it looks like in the game:
The thunderstorm sprite is just a temporary one which I drew myself! As you probably can see it does not really fit in with the artstyle. It is what it is and works as a temporary sprite to do some testing with the obstacle, and so far it works kind of as we want it to. To implement this obstacle I created a new class called “Thunder” with different functions. The functions in this class is actually quite similar to the functions in our “HardWinds” class which I talked about in a earlier post. The Thunder class stores the hitbox of the sprite which at the moment is equal to the thunderstorms size, 1920 x 300. When the player collides with the thunderstorm hitbox it increases the players stress. Stress represents the players health. The program checks the collision between the player and the thunderstorm by checking if the two different sprites overlap eachother. And if they do the collision function is initialized and a function from the HUD is called upon which increases the players stress. At this time this obstacle occurs every 20 seconds and has a duration of 10 seconds. This is achieved with a function which the HardWinds class also use. This functions uses three different float variables: one for elapsed time, one for duration and one for frames/second. As the game starts the frames/second starts counting and is equal to the elapsed time variable. And when the elapsed time is equal to the duration variable (which is 20 frames/second) the thunderstorm event is called upon. Like I said before this obstacle mostly works as we want it to, besides from two flaw. The players stressmeter increases extremly rapid as soon as the player enters the thunderstorm and kills the player within seconds after entering it. This makes the obstacle a bit unbalanced and need to be dealt with. The second flaw is that the thunderstorm just suddenly pops up without any warning and easily kills the player if the player is positioned on the high end of the screen. To fix this we have to implement som sort of thunder sound that alarms the player that this event is about to occur. So that is all from me this week! |
