This is an example template I use for the beginning of projects. It contains the basic layout required for a timer-based movement system.

Language: 
Dark Basic Pro
Code: 
sync on
sync rate 0


frameTime as float : frameTime = 1.0
startTime as integer : startTime = timer()
do
   frameTime = (frameTime * 0.8) + ((timer() - startTime) * 0.2)
   startTime = timer()
   
   rem YOUR CODE GOES HERE

   sync
loop
4.2
Average: 4.2 (5 votes)