My first game - complete!

Started by
31 comments, last by beebs 19 years, 8 months ago
Arrrr, make it time-based movements!
I can make 10 points in 1 second since the ball is moving so fast ;)
It's unplayable here.
Advertisement
OK. Does anyone have any suggestions to locking the frame rate to say, 30? Basically I have a loop that calls Game_Main_Proc();
Check out my first game here.
I think you could do something like:
do{//some code herestart_time=GetTickCount();//some extra code herewhile((GetTickCount() - start_time) < 33);


I think you do someting similar to that. Or so I read. I can look it up and correct myself unless someone here will do that for me.
Il definitely look that up thankyou. But why '33'? Is that in milliseconds btw?
Check out my first game here.
Ya. Sorry i forgot to mention that its all in milliseconds and 33 milliseconds is about 30fps.
Very nice! I have yet to complete my own pong clone :)
But it is too fast! I can't really play it because it goes so quick!

Thermo
GetTickCount() returns milliseconds, so 33 would lock it at 30 fps or so.

33ms = .033s
.033s * 30 = .99s
so 1 frame should take up 33 ms or so if u r shooting for 30 fps
normal_toes@hotmail.com
Don't lock the FPS. Look into frame-rate independent movement. The basic idea is that you measure the amount of time the previous frame took (in seconds) and multiply the next frame's movement by that delta. Locking the frame rate is asking for trouble.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Hey man, post the source!! :)
normal_toes@hotmail.com
When I have fixed this frame rate problem I will write a tutorial which takes you through making this game. This will a) hopefully make me learn more and b) help people who don't really 'get' putting it all together. Il put a link in this beginners forum so if you want the source look for that soon (tday, tmoro).
Check out my first game here.

This topic is closed to new replies.

Advertisement