What's touch 1 what's touch 2

tintrantintran Member Posts: 453
edited July 2015 in Working with GS (PC)

Planning to make a two joystick control like with touches.
Once touch to control movement, the other touch to control shooting direction.

Before I'd start I'd like to know this:
Is Touch1 always the first Touch that's initiated when there are no previously touches on screen?
and and Touch2 always the 2nd Touch if there's already one Touch on the screen?

I ask this because if that's true, I have to record which Touch it is since I wouldn't want to confuse Touch1's position with Touch2's position like if they pressed the Shoot Touch first I wouldn't want that Touch to control movement and vice versa...not sure i am asking that right.

If that is the case, what's a good way to determine like Touches position so that if user touches the left joystick first I can get that touches position and determine how to move character and if user touches the right joystick second I can get that touches position and determine how to shoot at a certain direction and that it would work if the right joystick was touched first it would the same..i don't want the first touch to always be movement but based on which joystick is pressed.

Best Answer

Answers

  • SocksSocks London, UK.Member Posts: 12,822

    @The_Gamesalad_Guru has done a few videos that cover touches.

    https://www.youtube.com/user/dsouza41/videos

  • tintrantintran Member Posts: 453

    too bad I clicked on video and it says An error occured. Please try again later. Maybe i'll retry in a little while see if i get lucky

  • ArmellineArmelline Member, PRO Posts: 5,408
    edited July 2015

    I made an insanely simple multitouch method a while back, I'll dig it out.

    It uses 1 actor, 1 rule and 4 behaviours and gives complete 11 touch multitouch. I can't remember how thoroughly I tested it though. I'll post it up soon.

    Edit: I remember now why I didn't release it. @The_Gamesalad_Guru did you successfully account for when two touches are so close together (time-wise, not position-wise) that both get registered in the same frame? I had no trouble attaching an actor to the correct touch, except when two were touched so closely together that both were assigned the same touch number.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited July 2015

    I never really experenced that issue with mine. Not sure how you coded it compared to mine. Although with the new touch booleans it's easier to do multitouch than it was. But it's still tricky stuff.

Sign In or Register to comment.