C++ 2D Shooter project (Htbaa's Worklog)
TrueType bug solved, scoring system added
Finally, my TrueType bug has been solved. When testing I was always able to dump the new created image and save it to a bitmap. But weirdly enough on Linux the texts would not show when being put onto the screen.
It turned out that the bug that was causing this was quite an easy one. In my KEText class, after I generate my new surface that will hold my text, I put it in my own KEImage format and set the clipping area. The clipping area is a rectangle, containing starting position (x,y) and ending position (w,h). I assumed if they were not set that they would always be 0 (which is the top left corner of my surface). Under Windows this was indeed what was happening. However, under Linux the x and y were set at something like -18000. Which is a blank space.
After finally having that fixed I can now continue with my 2nd milestone :-).
So I searched for some free fonts at 1001 Free Fonts and inserted them in my game. In my KEText class I added text alignment so I can align my text to the left, center or right. Neat!
My scoring system has also been implemented. It uses a multiplier to multiply any new scores gained by killing enemies. This will add some differences in the high scores that are going to be submitted for the online leaderboards. This way a player will actually have to try to score some!
On the screenshot you will see the score, aligned to the left, and the multiplier, aligned to the right :-). Nothing much really but this was one of those things that kept me away from doing further development on this game.
It turned out that the bug that was causing this was quite an easy one. In my KEText class, after I generate my new surface that will hold my text, I put it in my own KEImage format and set the clipping area. The clipping area is a rectangle, containing starting position (x,y) and ending position (w,h). I assumed if they were not set that they would always be 0 (which is the top left corner of my surface). Under Windows this was indeed what was happening. However, under Linux the x and y were set at something like -18000. Which is a blank space.
After finally having that fixed I can now continue with my 2nd milestone :-).
So I searched for some free fonts at 1001 Free Fonts and inserted them in my game. In my KEText class I added text alignment so I can align my text to the left, center or right. Neat!
My scoring system has also been implemented. It uses a multiplier to multiply any new scores gained by killing enemies. This will add some differences in the high scores that are going to be submitted for the online leaderboards. This way a player will actually have to try to score some!
On the screenshot you will see the score, aligned to the left, and the multiplier, aligned to the right :-). Nothing much really but this was one of those things that kept me away from doing further development on this game.
(Posted on February, 24th 2008, 18:21)
Comments
Htbaa said:
I thought so too! But people will also have to play the game to make the leaderboards exciting. I gues I need a wider audience that BS for that :).
(Posted on February, 24th 2008, 21:21)