How to reduce the performance of my game?

I created a game and the way to get the score is looking the time it took to pass a level.

I have tried a level with my Xperia Pro, and I can pass in 8 seconds

Then I tried it with a Samsung Galaxy and I can pass in 6 seconds, even in the simulator I can also pass  in 6 seconds.

Maybe the character movement is faster in a device than another?

How I can fix it?

Hahaha xD I have never seen anybody wanting to reduce performance :slight_smile:

It’s your implementation how player pass level. If you use movements based on framerate then be sure that this value never will be constant, even on the same device.

Then,  how i can change the framerate? Do you mean fps?

Yes it’s fps. You cannot change it. You can only limit it to 30 or 60 frames per second but real value will be always between 0 and this value.

Hi,

I don’t know what your game is about, but an idea would be to calculate the elapsed time between frames and do calculations with that time, for example when moving a character through the screen you can do

obj.x = obj.x + obj.speed * timeLastFrame

where

obj.speed: Object speed per second

timeLastFrame: elapsed time of the last frame in milliseconds 

So no matter the FPS you will always move at obj.speed per seconds.

Maybe you can work this out for your game

Hi @bigi.studios,

This tutorial may be what you’re looking for:

http://www.coronalabs.com/blog/2013/06/18/guest-tutorial-delta-time-in-corona/

Brent

Thanks Brent, that tutorial is actually great!

Yes i found it yesterday!! And is exactly what i was looking for!!

Thanks for your replys! :slight_smile:

Hahaha xD I have never seen anybody wanting to reduce performance :slight_smile:

It’s your implementation how player pass level. If you use movements based on framerate then be sure that this value never will be constant, even on the same device.

Then,  how i can change the framerate? Do you mean fps?

Yes it’s fps. You cannot change it. You can only limit it to 30 or 60 frames per second but real value will be always between 0 and this value.

Hi,

I don’t know what your game is about, but an idea would be to calculate the elapsed time between frames and do calculations with that time, for example when moving a character through the screen you can do

obj.x = obj.x + obj.speed * timeLastFrame

where

obj.speed: Object speed per second

timeLastFrame: elapsed time of the last frame in milliseconds 

So no matter the FPS you will always move at obj.speed per seconds.

Maybe you can work this out for your game

Hi @bigi.studios,

This tutorial may be what you’re looking for:

http://www.coronalabs.com/blog/2013/06/18/guest-tutorial-delta-time-in-corona/

Brent

Thanks Brent, that tutorial is actually great!

Yes i found it yesterday!! And is exactly what i was looking for!!

Thanks for your replys! :slight_smile: