Changing center of tilting

Here’s a simple code for how my player moves:


displayMode(FULLSCREEN)
supportedOrientations(PORTRAIT)

function setup()
    x=WIDTH/2
    y=HEIGHT/2
end

function draw()
    background(40,40,50)
    x=x+Gravity.x*10
    y=y+Gravity.y*10
    sprite("Planet Cute:Character Pink Girl",x,y)
end

How would I make it so instead of having the player start moving forward when the ipad is flat and instead have it start when it is still tilted towards me. For example if the ipad was at a 45% angle pointing at me the player is moving up the screen and when my ipad is straight up then it is moving down the screen.

Look at the Gravity demo app