guys, im curious how can we play “animation” when we tap instead of keep touching the screen. I have a game where if we touch the right arrow button on the screen the player would move to the right side, and if we touch the left arrow button the player would move to the left side. However the player feet animation only works if i keep touching the right arrow/left arrow button. The animation doesnt want to work (the feet doesn’t animate even though the player move) if i tap. Im not sure what it’s called in English but basically if you touch the screen for half second, then release it, then touch the screen again for half second and so on.
this is the script that i have
[code]waiter = sprite.newSpriteSheet(“MonkeySprite.png”, 56, 67)
waiterset = sprite.newSpriteSet (waiter, 1, 12)
sprite.add (waiterset, “playerleft”, 9, 4, 200, 0)
sprite.add (waiterset, “playerright”, 5, 4, 200, 0)
function touchleft (event)
if gameIsActive == true then
motionx = -speed
motiony = 0
player:prepare(“playerleft”)
player:play(“playerleft”)
end
end
left:addEventListener(“touch”, touchleft)[/code]
with the above script, the feet animation in MonkeySprite.png ONLY WORKS if i keep touching the left/right arrow button on the screen but it doesnt work if i tap it. How to fix this? [import]uid: 114765 topic_id: 23189 reply_id: 323189[/import]
[import]uid: 52491 topic_id: 23189 reply_id: 92964[/import]