No matter what i do i cannot get this sprite to move any faster. I know another app that set the frame rate to max but i don't want to do that and run battery down.
What am i doing wrong here?
Thanks in advance for any help
// Project: test 28
// Created: 2019-03-26
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "test 28" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetPhysicsDebugOn()
SetPhysicsGravity(0,0)
player = CreateSprite(0)
w = GetWindowWidth() * 0.05
SetSpriteSize(player, w, w)
SetSpritePositionByOffset(player, GetVirtualWidth() * 0.5, GetVirtualHeight() * 0.5)
SetSpriteShape(player,1) //0=no shape, 1=circle, 2=box, 3=polygon
SetSpritePhysicsOn(player,2) //1=static, 2=dynamic, 3= kinematic
SetSpritePhysicsFriction(player,0)
SetSpritePhysicsRestitution(player,1) //the 'bounciness' of the sprite
SetSpritePhysicsDamping(player, 0)
SetSpritePhysicsAngularDamping(player, 0)
SetSpritePhysicsIsBullet(player, 1)
SetSpritePhysicsVelocity(player, getVelocity(), getVelocity())
do
Sync()
loop
function getVelocity()
v as float
v = (random(1, 20) - 10) * 1000
endfunction v