Hi!
Some code
function handleEnterFrame() hero1.rotation = 0 if(moveToLeft == true) then hero1.x = hero1.x -7.5 hero2.x = hero2.x -7.5 heroAnim:setSequence( "left" ) heroAnim.x = heroAnim.x -7.5; heroAnim:play(); end end function Move(event) if ( event.phase == "began" ) then if(event.x \<= \_W) then moveToLeft = true end elseif ( event.phase == "ended") then moveToLeft = false moveToRight = false heroAnim:setSequence( "stay" ) heroAnim:play(); end end Runtime:addEventListener( "enterFrame", handleEnterFrame ) Runtime:addEventListener( "touch", Move )
When i touch screen my sprite move to left side and anims stop play
I know why: heroAnim:play(); start all the time. How to repair this code. There’s on event on focus touching the screen?
Thanks in advice