I want to make random object fall faster after a given time

58 views Asked by At

How do i make random objects fall faster after the player has scored 300 points in corona sdk im using physics to make these objects fall Can anyone please show me the code

1

There are 1 answers

0
meisenman On

Corona provides a runtime event called EnterFrame that runs every frame. You can use that runtime event to check against some condition (ex. reached a certain level or time) and if that condition is met, increase gravity.

local myListener = function( event )
    if condition then 
        local gx, gy = physics.getGravity()
        physics.SetGravity(gx, gy +10)
    end
end

Runtime:addEventListener( "enterFrame", myListener )