Touch Controls?

JBULLFROGJBULLFROG Member Posts: 58
edited November -1 in Working with GS (Mac)
I have a simple game, character moves left and right. The controls are set up as on screen arrows, left and right. When left arrow is touched (pressed or inside) I tell actor (player to walk left) and when touched (released) I tell actor (player to idle left) And the same for the Right arrow (walk/idle right). I then have two actors between the arrows to take into account you sliding your finger from one arrow to the other and touch is (inside) then tell the (player to idle left or right) depending on the actor that is touched.

The issue I am having is that when you touch the left arrow with your thumb on the iphone then slide it to the right arrow it works, but when you slide your finger back to the left arrow it doesn't seem to respond to the (touch inside) and the payer just keeps walking right when it should be walking left. I hope you can track with this, and any help would be great, thanks.

Comments

  • JBULLFROGJBULLFROG Member Posts: 58
    NM, I figured it out, I needed a separate attribute for each the left and the right arrow, setting each to 0 or 1 depending on which touch was inside. Before I had one attribute (MOVE) when game started it was set to 0, left would set it to 1, and right would set it to 2. The problem was that when it was set to 2 while touch was inside the right arrow and you slide your thumb over to the left arrow it would change it to 1, and the player would walk left, but it wasn't setting it back to 2 when you slide your finger back to the right arrow.
Sign In or Register to comment.