Touch movement and buttons. Possible?

edited May 2013 in Working with GS (Mac)
I am working on a top down prototype which involves having the hero actor move to where the screen is touched (this is working) but also attack when a button image at the bottom right of the screen is touched.

These both work, but when I touch the attack button, the hero actor moves toward it.

Any ideas?

TIA

Comments

  • BoomshackBarryBoomshackBarry Member Posts: 712
    edited May 2013
    You could create a game attribute called hudTouched (set it to 0) and then whenever the attack button is touched have hudTouched =1, else hudTouched = 0.

    Then in your move rules have the player only move when touch is pressed and hudTouched = 0 (ie when touch is pressed and the user is not touching any HUD buttons).

    I hope that sends you in the right direction :)
  • Good idea, thanks. I'll try that!
Sign In or Register to comment.