And then....SCORE!! Yes after many hours of struggling i finally managed to nail it! We now got score in our game. If my way of doing it is the right way. I'm not sure??.....but it works!
The way it works is that an unsigned int keep track of the score. 100 points for each destroyed brick. It then change the int to a string with the function std::to_string();
After that is done I have to track down the text object that holds the score. I used a text string to "tag" the object since all textobjects are stored in a <vector> I then delete that object and text and create a new object with the right score.
It works like a charm!
I also managed to get other text in game as well as you can see on the screenshot.
I then updated my black GameOverState to one with text. And with that I say good night and.......
No comments:
Post a Comment