Post

 Resources 

Console


Slowing down your game... The Gilb (0 replies, 0 views) (2000-May-9)
-
Wow! I'll have to look into that one! Course I normally use late binding anyway - just because of my coding style. However, I did a bit of experimentation and found a brilliant way to control the speed of your game without even altering the FPS! I found out a way to do movement based on the number of milliseconds elapsed... Movement based on time... I did a tutorial on it on my webpage (http://www.geocities.com/thegilb/), but the tutorial is too long winded for such a simple concept. Basically alls you do is set the player to move so many pixels per second, then you use a double precision integer (Which would naturally cause some slowdown, however I haven't measured it), then you move the player as a percentage of how much time has elapsed. I dont think my way is the best way of doing it. I'm not sure... However I do find that the best way to do things is to put a frame limiter on the main loop, AND do everything based on time... Well anyways - you probably knew that stuff already - but it might help some others anyway... :-)


-
Up One Level | Back to Forum


Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 64 visitors within the last 20 minutes
RSS News Feed