# Calculate speed of object for specific device

I have an object - player - which is moving X px ahead each update (updates based on device FPS). From my results, to get average same player speed on all devices, is to do calculation screenWidth / averageFPS. This should give me speed, that player reaches mobile screen width for one second (note my game is in landscape mode). But it doesn't, it was significaly faster on Z3 Compact (720x1280; avg. 60FPS) than on tablet A5600-F (800 x 1280; avg. 62FPS).

How to get correct speed?

• Are you sure screenWidth value is 1280 instead of 720 or 800? Maybe your calculations are right but you're working on wrong values because of landscape mode. Even though, be sure screen size values are updated to the phone view mode. – liggiorgio Dec 2 '15 at 22:01
• By the way, as @Almo suggest you shouldn't be working in pixel coordinates, neither your game shall depend on device frame rate. Delta time was introduced right to simplify the programming aspect of games dynamics. Game physics must always be independent from drawing the game view. – liggiorgio Dec 2 '15 at 22:04