Tutorial on Swipe control

VolontaArtsVolontaArts Member Posts: 510
edited August 2013 in Working with GS (Mac)


followed this video on swipe control. Great tutorial. been trying to figure out how to have it swipe to certain x locations.

like if i was to swipe left it moves over 100 pixels. if anyone has any idea that would be great thank you.

also he is using when mouse is up? and when mouse is down? does this mean it not for iphone touch screen?

Comments

  • VolontaArtsVolontaArts Member Posts: 510
    ok well i noticed he uses accelerate towards. so i changed that to move to. buy that isnt working right. or maybe i just dont know how to use it.
  • VolontaArtsVolontaArts Member Posts: 510
    any ideas? i keep trying things out but not having luck...
  • DreamLabDreamLab Member Posts: 2,127
    You want it to swipe to a specific location, or 100 pixels over every time you swipe? Two different things.
  • VolontaArtsVolontaArts Member Posts: 510
    @dreamlab 100 over. Its a tetris like game so i have to have exact x coordinates. thanks for your response
  • DreamLabDreamLab Member Posts: 2,127
    Okay so you need to make a few real attributes. TouchX1 and TouchY1. When touch is pressed (or mouse button is down), change touchX1 to mousepositionx and touchy1 to mousepositiony. Then for the swipe rule, use either the interpolate or move behavior and have the rule say "When mouse position X is greater than (touchx1)+20, swipe (interpolate) right" and for left it would be "When mouse position x is less than (touchx1)-20, swipe left". Same goes for up and down, just use touchy1 instead of touchx1.

    In regards to going 100 pixels over, just say interpolate self position x, to self position x + 100. Should work.

    Let me know if you have any questions
  • VolontaArtsVolontaArts Member Posts: 510
    genius! thank you @dreamlab makes perfect sense
  • VolontaArtsVolontaArts Member Posts: 510
    @dreamlab do you have any apps out? i will download and comment on them for your help...
  • DreamLabDreamLab Member Posts: 2,127
    Not at the moment, working on one though! Still a senior in high school, got lots of grades and extracurriculars to keep up with.
  • VolontaArtsVolontaArts Member Posts: 510
    nice wish i started early...gl man
Sign In or Register to comment.