Help: multi touch to stop, multi touch again to resume with original velocity

anithmukanithmuk Member Posts: 235
edited November -1 in Working with GS (Mac)
Pretty much in the title. How would I make it so that when you touch the screen with 2 fingers the actor stops and when you touch again with 2 fingers it continues with its original speed and direction?

Also, how would I test the multi touch in the gamesalad creator on my mac?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    first your gonna need to make a actor, change its alpha to 0, and stretch it to cover the whole scene. Thats gonna be your touch area. Next make 2 real attributes playermotionx and playermotiony, and make a interger attribute stop and have it set to 0.

    In the actor that you stretched over the scene have a rule if touch is pressed and devices.touch.count =2

    change attribute stop to (stop+1)%2. That will toggle it between 1 and 0.

    Then in the player actor have a rule when stop=1 change attribute playermotion x to motion linear velocity x and change attribute playermotiony to motion linear y. Then have a timer with after .1 seconds with run to compeltion checked, and put 2 change attriubtes in that timer. Change motion linear x to 0 and motion linear y to 0.

    Then have one last rule in the player when attribute stop=0 change attribute motion linear x to playermotionx and motion linear y to playermotiony

    hope i helped
  • anithmukanithmuk Member Posts: 235
    wow, thanks! If you wouldn't mind I have a couple more questions.

    1. So how do I test this on my mac, as I can hardly use touch controls, or do I have to set other controls so I can play my game in gamesalad?

    2. Is there a way to know where the player is touching in the scene? For example, so you can spawn an actor where the player touches?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    well you cant test multi touch on the mac, so like you said set other controls.

    The rule thats when touch is pressed and touch count equals 2 you can change to when key b is down and key y is down or something like that.

    And for the second question your gonna be using that invisible actor thats stretched over the whole scene. In that actor have when touch is pressed spawn actor, in the spawn actor behavior in the x position go back into the devices attributes go back into touch go to touch 1 and choose x. Then in the y position go threw the device attributes again youch 1 and choose y. And make sure its relative to the scene in the spawn behavior

    cheers
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    tshirtbooth said:
    to slow !

    :)

    hehehe, its gettin a little later over here in new jersey, the minds slowin doooowwwwwnn..n..n ;D
  • anithmukanithmuk Member Posts: 235
    cool, thanks for the help :)
  • aandiaandi Member Posts: 99
    how do you do this but with rotaton
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    So since you were told you would be banned if you made another thread, so you started bumping year old ones with the same question instead?

    closed and reporting you now.
This discussion has been closed.