On Touch Question

CaptFinnCaptFinn Member Posts: 1,828
edited November -1 in Working with GS (Mac)
I have my game set up so that when you touch the screen the turret quickly turns to where you touched and fires. I want to set up a toggle button on the screen that switches weapons from a single turret to a double shooter or a triple shooter. But I dont want the current turret to fire in the direction of the toggle just because I pressed it to switch weaps. Is this possible?

PS. I should note that the turret is in the middle of the screen and can fire in a 360 range. its not like missile command.

Basically I want the current turret to ignore the touch. if its touching to switch weapons.

Comments

  • ApplaudAppsApplaudApps Member Posts: 308
    Hi Jeff,

    Yes you can do this. Have a rule in the switch button that sets a boolean (switchpressed) to true when its touched and sets it back to false when its done the switch.

    Then add a rule in your whole screen touch rule like :
    when touched and switchpressed=false then do stuff (rotate and fire)

    you might need to add a very short timer if it still rotates and fires such as :

    rule when touched :
    timer after 0.1 seconds
    rule if switchpressed=false then do stuff
  • CaptFinnCaptFinn Member Posts: 1,828
    I like TSBs suggestion.. Much easier for me to understand.
Sign In or Register to comment.