Sprite speed dependes on Phone

Hello, everybody!
Pls explain me how to solve the following problem.
Im making a game and I have a Sprite that moves with constant speed.
But if to compare the speed by eyes on different devices, the speeds are different.
Modern phone with bigger screen has bigger speed than smaller older phone.

May be there is a way how to solve this problem?
May be its possible to change the Intervals of Sprite depending on resolution of device?

Set Interval to whatever makes sense and keep it the same for all devices.

It’s the speed property that needs to change. Figure out how long it should take the sprite to move from the top of the canvas to the bottom, or from the left to the right.

Say your interval is 20 - this means the sprite will move every 20 milliseconds (ms), or 50 times per second.

If you want the sprite to take 1 second (1000 ms) to move from top to bottom, your speed will be 20 / 1000 x canvas height. Or even better, 0.02 x canvas height.

Now regardless of screen size it will take the sprite 1 second to move from top to bottom on every phone.

See here for more info about universal screen sizes (not by me, all credit goes to the author).

1 Like

deanart2012, thank you very much, I understand and will try.