i am applying a
square:setLinearVelocity( )
but the square dont runs the same distance in different devices , it seems the “setLinearVelocity()” goes faster in devices with different screen resolution
for example
in the Toshiba Excite 10(1280 x 800 ) goes slower than a huawei ascen y100(240 x 320)
but the simulator runs all the same in multiple resolutions
i need a way to fix this, please thanks everybody
local function onEveryFrame(event) if(player.square~=nil ) then --ANGLE OF THE CONTROL local angleDeg = math.deg(Tan) if(angleDeg\<0)then angleDeg = (180+angleDeg) + 180 end --ANGLE OF AIRPLANE local objt\_angle = player.square.rotation % 360 ---20 local finalForceX = (math.cos(math.rad(objt\_angle)) \*FIXED\_VELOCITY) local finalForceY = (math.sin(math.rad(objt\_angle)) \*FIXED\_VELOCITY) local angleVel = angleDeg - objt\_angle --///AGNEL if(math.abs(angleVel)\>180)then if(angleVel\<=0)then angleVel = 360 + angleVel else angleVel = angleVel - 360 end end angleVel = angleVel \*MAX\_FORCE if(angleVel\>MAX\_ANGLE\_VEL)then angleVel = MAX\_ANGLE\_VEL elseif(angleVel\<-MAX\_ANGLE\_VEL)then angleVel = -MAX\_ANGLE\_VEL end player.square:applyAngularImpulse( angleVel/100 ) player.square.angularVelocity=angleVel if(player.isFlying == true )then player.square:setLinearVelocity( finalForceX, finalForceY ) end end end