Having a problem with touch buttons working together...

billpaternobillpaterno Member Posts: 26
edited November -1 in Working with GS (Mac)
I am working on a simple interface for moving my main actor. Mouse click left button, and main actor moves forward and to the left a bit. Mouse click right button, and main actor moves forward and to the right a bit. Click hold either button and actor rotates in place.

I created two game attributes. game.LeftMove and game.RightMove. They are boolean and set to false. I then created two buttons...each are separate actors but the same image (just rotated).One rule is left button receives mouse button down, change game.LeftMove to true. The other rule is left button receives mouse button up, change game.LeftMove to false.

The settings for my main actor to be controlled below:
http://i45.tinypic.com/2w3qbzd.png

Everything works fine when I first tested one button (the left side). However, when I added the right button, then the left button acted exactly as the right button. If I remove the right button, the left button works fine again. I know I am missing something here. What is it?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    you need to make sure you are setting game.Right to FALSE when you click the left button as well.

    So:

    When you press the left button,
    set Left to TRUE
    set Right to FALSE

    and vice-versa for the right button...
  • billpaternobillpaterno Member Posts: 26
    ahhh...thanks dude! I owe you a beer!
  • billpaternobillpaterno Member Posts: 26
    tried it and it is still not working :( I did both left and right as you said. Now either button rotates the opposite way. Does it have to do something with the timers I have enabled for the rotation?
Sign In or Register to comment.