completely stop actor from moving when tapping a button
iPhoneDevForMe
Member Posts: 362
My actor is set to move left and right based on accelerometer input using acceleration!
I want to be able to tap a button, and when this button is tapped, stop the actor moving.
I currently have the rules set up with a boolean game attribute called moving. If moving is true, accelerate (the direction of course is based on the accelerometer). When my button is tapped, change game.moving to false.
This stops the actor by decelerating, but I want it to stop immediately.
If I change from accelerate to move, the movement is too choppy, so is there another way to do this?
I want to be able to tap a button, and when this button is tapped, stop the actor moving.
I currently have the rules set up with a boolean game attribute called moving. If moving is true, accelerate (the direction of course is based on the accelerometer). When my button is tapped, change game.moving to false.
This stops the actor by decelerating, but I want it to stop immediately.
If I change from accelerate to move, the movement is too choppy, so is there another way to do this?
Comments
Works like a charm! Im gonna try playing with showing/hiding the actor for a more smooth gameplay! Thanks a lot!