这里有点绝望。我正在尝试在 Corona SDK 中制作跑步游戏,但无法从跳跃动画过渡到跑步(跳跃后返回)。
local function touched(event)
if(event.phase == "began")then
char.accel = monster.accel + 20
char:prepare("jumping")
char:play()
else
char:prepare("running")
char:play()
end
end
在这段代码中,如果玩家不断触摸屏幕,跳跃的动画在地面上不断重复,有没有办法及时限制触摸事件?
还尝试通过另一种构造实现动画:
if(onGround) then
if(wasOnGround) then
else
monster:prepare("running")
monster:play()
end
else
monster:prepare("jumping")
monster:play()
end
但是由于某种原因,跳转动画只显示第一帧。
任何帮助将不胜感激!提前致谢。