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 Classic Chat / timer question, diff. devices

Author
Message
Marla
12
Years of Service
User Offline
Joined: 7th Dec 2011
Location:
Posted: 18th Feb 2013 18:58
hi,

one general question...

different hardware = different cpu power etc.

how do you handle this?

you know, on one device a sprite might move faster than on the other one.

on one device the game might be faster than on others...

how do you handle this?!

thank you!!!!!

best,

m.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Feb 2013 19:15
You could multiply the desired movement/rotation amount by GetFrameTime()

For example, assuming a virtual resolution of 100x100, and you want a sprite to move at 10% across the screen per second, you'd do something like this:

This *should* result in all movements/rotations occurring at approximately the same speed. This will only cause an issue if the frame rates are extremely low, or extremely high. (Low enough to be jerky, or high enough to run out of decimal precision)

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Feb 2013 19:25 Edited at: 18th Feb 2013 19:28
Setting the Framerate.
SetSyncRate(60,0) = 60 Frames per Sec.
print(screenfps()) in main loop

But some mobile Devices have not the power,
you must reduce the max. frame rate or optimize the code as you can.
fly over your code in mind and think what you do unnecessary.

a pc today have to much power,they can sleep awhile until the next frame must be prepared.

edit:
if you use physics, it knows the frame time
Marla
12
Years of Service
User Offline
Joined: 7th Dec 2011
Location:
Posted: 18th Feb 2013 19:39
ok, thank you, will give it a try!!!
Marla
12
Years of Service
User Offline
Joined: 7th Dec 2011
Location:
Posted: 18th Feb 2013 20:13
...that's what I find difficult:

i have developed using dragonfiresdk until now, so just for iphone / ipad. and even there you have to think about different resolutions etc.

hope to get it done...

THANK YOU!

Login to post a reply

Server time is: 2024-05-02 06:23:48
Your offset time is: 2024-05-02 06:23:48