It's The Little Things We Do

Published September 02, 2009
Advertisement
Here is the first demo for Cops & Robbers! (Source code included) [grin] So, what do you think?

Quite a few small things done today. First, I managed to get money implemented so that when you go to the pick up point you 'carry' some money (determined by the game timer) and then when you reach the drop off point that money gets added to your total money.

Second, I added arrows to point you in the direction of the target if it is offscreen. (I may make this a bit batter and have it align itself with the target. At the moment, it's just halfway across that side of the screen)

Third, I made movement a little better. Previously you could overlap the tiles because I was checking the midpoint of the leading side. (This was because sometimes the tile being checked was wrong so that some 'passable' blocks seemed 'impassable'). To solve the overlapping problem, I just reset the player's y value.

Fourth, I was having problems with the game slowing down a lot after ~5 minutes. I realised that I wasn't releasing the 'string image' (for writing on the banner) before reloading it again. This cut the slowdown to occuring after ~10 minutes. Then, I changed the collision detection function to accept pointers-to-SDL_Rect instead of the SDL_Rect themselves. This cut me down to about 12/13 minutes. Then, I finally realised that what was causing the slowdown was the fact I was reloading the 'string image' file every time. So I now have two. One which is always clear and is applied to the 'string image' every time. It was immediately noticeable that this worked beacuse the WHOLE GAME ran faster [lol]. I had thought the player's car was slow because I had set the velocity too low but that wasn't the case [smile].

Finally, I updated the menu for quiting and changed the colours around on the other menus (still placeholder though).

So next, I'm onto step 7 (formally known as step 6) - the cannon! [grin]

Any comments would be greatly appreciated.
Thanks for reading
-AEdmonds
Previous Entry Take Me Out
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement