Major multi touch issue

MightyBooshMightyBoosh Member Posts: 83
edited November -1 in Working with GS (Mac)
Multi touch problem

I have a huge problem (spend over 2 days trying to work it out).

I have a made a control pad and a fire button that both work independently  when touch is pressed. The control pad controls a crosshair 

Crosshair X = (controlpad*2)+320

And if I hold down the control pad I can still fire. This all works perfectly. 

The problem is if I hold down the fire button the control pad doesn't work. I have tried using touch gestures but I don't really know what I'm doing

Can any one help please I'm so stuck? 

Comments

  • reddotincreddotinc Member Posts: 653
    This is how I would do it:

    You'll need to have separate instances and variables, say leftTouch and rightTouch.

    leftTouch

    if touch is pressed

    change game.leftTouch to 1

    otherwise

    change game.leftTouch to 0

    ----------------------------

    rightTouch

    if touch is pressed

    change game.rightTouch to 1

    otherwise

    change game.rightTouch to 0

    ----------------------------

    Then you can set things to happen when leftTouch or rightTouch = 1.

    Hope that helps.

    // Red Dot Inc
  • RHRH Member Posts: 1,079
    Check out CodeMonkey's joystick demo. It will show you how to determine which touch is being used. It's pretty simple and easy to implement. Good luck with it
  • MightyBooshMightyBoosh Member Posts: 83
    Yeah Code monkeys joystick demo was the basis of my game. I just adapted it to work. I have solved the solution although i'm not completely sure how... I will try to find out and report

    Thanks for your help
Sign In or Register to comment.