Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Graphics 2.0 Accelerometer performance
Started by BJensen Mar 04 2014 09:24 PM

No replies to this topic
graphics 2.0 accelerometer
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 7 posts
  • Corona SDK

Prior to moving over to graphics 2.0, my app using accelerometer was working well on test devices 3Gs, 4s, 5, 5s iPad mini, and iPad 3.  After updating everything to graphics 2.0,  the player is laggy on iPhone 5, a little better on iPad 3/4, but is really horrible on iPhone 5s the player swings sporadically across the screen and lags bad when changing from one side tilt to the other. I'm using build 2188, I built most of the app in build 1235 and everything ran well until upgrading builds and graphics to 2.0.  Here is a snippet of my tilt code. I have set accelerometer to 60 to match the fps which is set at 60 in config. Any ideas? My app orientation is landscapeLeft and tilt moves player from side to side. 


    local function onTilt ( event )
        if gameIsActive then
            if playerObject.x <= 0 then
                playerObject.x = _W - 1
            elseif playerObject.x >= _W then
                playerObject.x = 1
            playerObject.x = player.x + (playerObject.speed * event.yGravity)
Runtime:addEventListener( "accelerometer", onTilt )