PowerupHUD

Hi Everybody! (Hi Dr.Nick!)

As the switch to English last week seemed to be a popular change, I am sticking to it this week as well. This week has been a lot about doing different smaller changes and polishing everything  to make the game feel a lot more tight. Since we are pre loading all the assets, this meant making a loading screen, but also polishing the high score menu, and adding buttons to the lose and win state.

The most interesting thing that has happened this week though, is the addition of PowerupHUD. Initially this was another programmers responsibility, but the task turned out to be more complicated than we had initially thought, and this meant all of us became involved. The initial thought was that the PowerupHUD would show if you had any power ups in your inventory to dispose of, and also make the player able to choose which power up to activate.

We started by doing a new class that would load in four textures, one texture for each power up, and also one arrow pointing at whichever power up was selected. The idea was to make the arrow switch between the different power ups.

We created a struct* containing 6 different bools**. 3 bools to check if the player had picked up any power up, and 3 bools to check which power up was currently selected in the HUD by the player (this could have also been solved by making an int(number value) and check the number value instead of bools). After this struct had been created, we had to link it to the playerclass that handles all the power ups, and then make different if statements to check if the power up exists in the inventory and also check which power up has been selected in the HUD by the player.

 

Picture of what the HUD looks like right now. A new version of all the bars on the left is in the making as I am writing, and the final version we are displaying tomorrow will look a lot more clean.12722240_10154040542158270_1789078491_o

As you can see on the screenshot above, the power ups on the left are completely black. This means that the player does not have any power ups in his inventory. The arrow to the left of the power ups, shows which power up that is selected. When the player picks up a power up, the sprites on the left will receive full color.

Kindest regards,

Anton Olin

* A struct is a sort of pool containing functions and/or variables.
** Bool and int are examples of different data types that can be used when creating variables or functions. A bool can only be true or false (1 or 0) and an int can only be numbers, but can not contain decimals.

One thought on “PowerupHUD

  1. Hello Robert here, i had a chance to play your game in the playtest and it was great! i do believe this was the game that was a little bit too easy nevertheless i liked it!
    The first thought that popped into my head while reading this is why was the powerup hud more difficult than you had initially imagined. Also i am wondering what happens if the player say picks up more than one powerup of the same kind? i liked that you explained in the bottom what the different kind of things that you talked about in your blog post were like you explained what a bool was and so on.

    also i dont quite understand how your poweruphud system works specifically how does the hud know which powerup is in the inventory or was that also checked inside of your bool like for example when the player picks up a powerup it is put in the inventory then the bool checks what powerup it was then it is displayed in the hud, i thought that it was a little unclear if that was how it worked.

    But anyways great job with the game it looks cool and the feeling while you played it was great!

    Good job group 4! and good luck with the theme park!

    Like

Leave a comment