Shockwave PowerUP LAST CALL!

Dear, reader.

This week I have had a lot of bug fixing to do but i also had to work on a few items we weren’t able to make in time for our beta testing. So today i will write about our shock wave power up that I been working on this week.

Foremost we wanted a Time bomb as a power up that you threw out of the ship that would explode after a couple of seconds. But the closer we came to the beta testing we decided as a group to scrap the time bomb and create something easier. We ended up our discussion by choosing to make a power up similar to that of the electromagnetic pulse like power up but since our enemies isn’t electrical and is organisms made out of alien anatomy that isn’t affected by an electromagnetic pulse. So we choose to implement a shock wave made out of high compressed air and sound to kill everything on the screen because it would be much easier to create by simply scaling it and setting the position on the player.

This was easy to execute by simply making a shock wave class where we loaded a texture animation to our sprites and then to make it expand, I began by increasing the scale of the sprite by using the SFML sprite own function by typing scale and writing withing parentheses how much the sprite will grow ex. 1.04 is increasing by 4 percent, I called this function with each update of the shock wave class. Now I needed to continue with the collision of the shock wave power up.

Our collision structure uses the float rectangle function from the SFML library to create a hit box. But as the shock wave expanded the hit box didn’t change position and just expanded to the right and down so I had to change it. I knew my friend had done a similar power up when he did his electromagnetic pulse. But as I mentioned earlier I wouldn’t be able to use an electromagnetic pulse. So I came to the conclusion that I would just remove the enemies when I removed the electromagnetic pulse. First I tried to remove the electromagnetic pulse when the pulses hit box collided with the windows edges but as the hit boxes position didn’t work properly. I added a timer that would start when I fired the pulse and then remove both the electromagnetic pulse and enemies when the timer hit 1 second.ShockwaveAnimation

About Christoffer Lövdahl

2015 Game Design