Hi All -
Does anyone know of a good class for making a JUMP button for a mario brothers type game?
Thanks!!
D [import]uid: 113537 topic_id: 19776 reply_id: 319776[/import]
Hi All -
Does anyone know of a good class for making a JUMP button for a mario brothers type game?
Thanks!!
D [import]uid: 113537 topic_id: 19776 reply_id: 319776[/import]
there’s plenty of discussions about that on forums, please use search)
its very basic function by the way [import]uid: 16142 topic_id: 19776 reply_id: 76623[/import]
@danimaltex were here is an example of a jump button
[code] local onTouch = function(event)
if ball.canJump then
ball:applyLinearImpulse(0, -5, ball.x, ball.y)
end
end
Runtime:addEventListener(“tap”, onTouch)
local function onCollision(self, event )
if ( event.phase == “began” ) then
if event.other.stage then
ball.canJump = true
end
elseif ( event.phase == “ended” ) then
if event.other.stage then
ball.canJump = false
end
end
end
ball.collision = onCollision
ball:addEventListener( “collision”, ball )[/code]
Here is an example of a jump button if you don’t understand just tell me [import]uid: 17058 topic_id: 19776 reply_id: 76675[/import]