Tags

,

What I did last week was the power up fire projectile, and how it worked. This was not that well explained.The collision between the player and the power up was done, the thing I needed to do was to set it to be activated, else it would not do any function. So I set an statement in the collision check of the player<->power up and made and activation variable. So when I collide it will set to be activated and I can use that to make a lazer projectile. The problem that occurred was that it did not know what to use, the normal projectile or the lazer, it just continued to use the normal projectile.

Namsadnlös.png

To fix this I needed to do an “if” and “else”. I started of doing and “if” statement where it checks if the power up is activated or not, and if it is activated the “if” statement will be used. But if it is not, the “else” statement will be run, which is the normal activated. This worked! nevertheless a problem… It stayed in the “if” statement. I needed to make it a time limit where it goes for around 5 seconds then makes the power up activation to false again, till it collides again. After using the SFML´s TIME function I tried if it worked and it did, barely.

Namnlöaadaads.pngThis week I worked to make this time to work correctly, it was hard and I am still working on it. The problem is that it does not restart the clock when it is picked up, the power up. I have to pick it directly at the start of the game because the clock is started from when I start the project. I had it all worked out, but we had to change some things in the code that complicated everything.. What I did last time was to set the whole “Source file”, which is the file I set the “if” and “else” statement to be in seconds. Now when we have changed the code where I settled that, it could not be done. Now I am working on how and where I could set it to be as seconds, which should not be a huge problem. Just some time of trying and testing different things.

What I will do next is the nuke clear power up, which is an power up that activates itself automatically when picked up and clears the whole screen of enemies instantly.

 

That is all for this week.
Axel Eriksson