Multitouch problem. Need help!

MarkOnTheIronMarkOnTheIron Member Posts: 1,447
edited January 2012 in Working with GS (Mac)
I'm having some troubles figuring this out. Maybe it's simple but I have my head over so many things that I came to a dead end.

I uploaded an image to better explain what I need:

1. I have two "hot zones" that when pressed move an object in different direction.

2. When I press the zone on the right it activate.

3. Then I add a second touch to the zone to the left. But since only one touch should be allowed at any time this second touch shouldn't be registered.

4. Then I lift my first touch and at this point the second touch should be registered and activate the left zone.

I'm stuck I can't figure how to register that a touch is no more. Using the Touch position is useless because when you lift a finger the position of the touch remain as it was before lifting it. Using touch count also don't help.

image

________________________________
【ツ】iPhone Icon Pack (compatible with DBA Icon Creator) 【ツ】 - 【ツ】Graphic Pack【ツ】
Free GS demos: High score simple and advanced; Game Center; App Rating System; Custom Font Score and Countdown; Advanced Snap to Grid

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    Thanx for sharing your troubles @MarkOnTheIron … so enjoyed adventuring down your dead ends! :P

    2 gameAttributes real touch2X and touch2Y

    R side hotspots
    Rule: when
    Event: Touch is pressed
    --Rule: when
    Attribute: game.Touch.Count < 2
    --changeAttribute: game.Touch.Count To: game.Touch.Count+1

    L side hotspots
    Rule: when All
    Event: Touch is pressed
    Attribute: game.Touch.Count = 1
    --changeAttribute: game.touch2X To: game.Touches.Touch 1.X
    --changeAttribute: game.touch2Y To: game.Touches.Touch 1.Y
    (that sounds confusing but the touches' number reverts to 1 when all touches are released)

    Rule: when All
    Event: Touch is pressed
    Attribute: game.Touch.Count = 2
    --do whatever you want with the stored X and Y

    oh, dear, my mind is boggling!

    @};- MH
Sign In or Register to comment.