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.
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.
This 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
eggetcool said:
Nice blog post Axel!
First I will say what I think is good in the post and then I will address what I think can be improved for next time!
The post as a whole is good with informative text and a simple explanation on how you tackled your problems. I am guessing that even a person that has never coded before in c++ or any other programming language could understand what is happening and the progression you make.
The text has a nice common thread throughout the text.
What could have been done better is the spellchecking, there are some sentences with double words and some incomprehensive ones that you can understand but should get looked over one last time!
The explanations could have been a bit more detailed and longer because I would like to know a little bit more about the steps you took to solve your hinders. For example when you talk about the “if” and “else” statements below the first picture it would be nice to know what they do more precisely, right now it only says the “else” statement’s action. If you did this it would be even easier for people with no coding knowledge to keep up with what does what and what the different functions and statements do when they are true.
Overall a good text about your weeks work!
LikeLike