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.

AppGameKit Studio Chat / Counter increment from FPS standpoint

Author
Message
2D Analyst
AGK Developer
15
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 5th Oct 2019 16:47
If I remembered correctly, FPS is the number of Frames per Second. Let me use an example from my game.

I have FPS set to 30.
I set my counter variable to increment 1 up to 30.

Does this mean that when the counter is set to 1, it's actually 1 out of 30 frames.

Set to 2 means 2 out of 30 frames.

Finally, when this counter reaches 30..it's 30 out of 30 frames also equivalent to 1 second?
PSY
Valued Member
3
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 5th Oct 2019 19:31
If you set your FPS to 30 with SetSyncRate ( 30, 0 ), the following loop will run 30 times per second, meaning i will have a value of 30 after one second.
If you set your FPS to 1337, the loop will run 1337 times per second, meaning i will have a value of 1337 after one second.
If you set your FPS to max, the loop will run as fast as your machine permits.

do
i = i + 1
sync()
loop


PSY LABS Games
Coders don't die, they just gosub without return

Login to post a reply

Server time is: 2020-04-05 21:29:50
Your offset time is: 2020-04-05 21:29:50