It looks like you're new here. If you want to get involved, click one of these buttons!
function game:onEnterFrame() if MoveLeft == true then Ship:setPosition(Ship:getX()-2,Ship:getY()) Ship:setRotation(-30) end if MoveRight == true then Ship:setPosition(Ship:getX()+2,Ship:getY()) Ship:setRotation(30) end if MoveLeft == false and MoveRight == false then Ship:setRotation(0) end end function game:MoveShip(event) if Left:hitTestPoint(event.touch.x,event.touch.y) then MoveLeft = true MoveRight = false end if Right:hitTestPoint(event.touch.x,event.touch.y) then MoveRight = true MoveLeft = false end if Fire:hitTestPoint(event.touch.x,event.touch.y) then print("fire") end end end function game:StopShip(event) if MoveLeft == true then MoveLeft = false end if MoveRight == true then MoveRight = false end end |
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Another option could be to check the hitTestPoints of the buttons directly in enterframe and act accordingly.
If you can share your project I will try to make it work but I am too tired to setup a dummy project to make a test right now
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game