Hi!
i Create some jumping
local ground 400; local jumpHeight = 150; local RunnerDown = function( obj ) runnerTransition = transition.to( obj, { y=self.y + jumpHeight, time=runnerTrasistionTime} ); runnerRotation = transition.to( obj, { rotation=obj.rotation + 90, time=runnerTrasistionTime } ) end function RunnerJump(self, event) runnerTransition = transition.to( self, { y=self.y - jumpHeight, time=runnerTrasistionTime} ); runnerRotation = transition.to( self, { rotation=self.rotation + 90, time=runnerTrasistionTime, onComplete=RunnerDown } ) end local runner = display.newRect( 0, ground, 100, 100 ); runner:setFillColor( 1, 0, 0 ); runner.myName = "runner"; physics.addBody(runner, { bounce = 0.2 }); runner.touch = RunnerJump;
but my object allways go to my start point, i want runner stay on some kind of floor. Any solutions or hints?