Multi touch ID's

ShanestaShanesta Member Posts: 63
Ok, so I got my game running on the test app on my iPod 3rd gen, Good job on that guys!

My game has dual thumb stick controls, and I'm kinda confused about how they would work with multi touch. I got it working by assigning the left stick to touch 1, and right stick to touch 2. This works if you touch the left stick first, but if you touch the right stick first, it breaks obviously.

How can you dynamically link the touch in one area to some controls, no mater what touch id it uses. Seem like there needs to be like a local touch option.

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Still working on that to be easier.
    You could do the painfully logical method and compare the coordinates of each touch if they are within the area of the control. But its so complicated I don't even want to write out that logic. :p
  • ShanestaShanesta Member Posts: 63
    You need to just be able to grab the id from the touch that is initiating the touch event, and then use that ID, maybe just have a local ID option in there with the touch ID's. Multitouch is useless if you can dynamically work with the touches.

    Yea manually tracking all touch ID's seems like a pain.
  • butterbeanbutterbean Member Posts: 4,315
    Is there still a default gamepad that we can use with the one button? I was just going to do that for now until multi-touch get's easier, or you guys add a default gamepad with 2 buttons and a D-pad... much easier!
  • jmp909jmp909 Member Posts: 73
    presumably the joysticks are on either side of the screen.. can't you just check whether it's < 240 or > 240 ? and also whether touch 1.x > touch 2.x etc and then set game variables to say which touch is controlling which joystick?
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    The joystick demo they are speaking of is actually updated and is a great template for touch number detection.

    I used it for a two player split screen game so that the players dont get touches mixed up.
Sign In or Register to comment.