Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Time based values. Simple movement and adjustment per second

Author
Message
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 28th Jun 2015 16:25 Edited at: 28th Jun 2015 16:26
This simple snippet supplies 2 floating point functions with two integer equivelents to be used as a starting point when creating a value to be affected by a passage of time. For example, if a player must move 10 units per second, you can use the UnitsPerSec# function to return the required units given your current update duration, or the PerSec# function with a parameter used as the timespan.

Develop this further into something more complex and consistent when the need arises.



Login to post a reply

Server time is: 2024-03-29 00:29:41
Your offset time is: 2024-03-29 00:29:41