Swipe to jump

MattVolletMattVollet Member Posts: 86
edited November -1 in Working with GS (Mac)
Hey all, does anyone have a good example of a swipe to jump type deal? I'm trying to make a character move based off of the velocity and angle of the user!

Thanks guys!

Comments

  • iDeveloperziDeveloperz Member Posts: 1,169
    Intriguing. Well I would start by looking at some of fire maples tutorials. He has some great ones for things like this.
  • HachikoHachiko Member Posts: 330
    I never tried, but I think you can do something like this:

    when mouse is pressed, save Coordinate Y in a self.attribute or game attribute, your choice.
    when mouse is released, save coordinate Y in another one.
    Then, check last saved coordinate Y - first saved coordinate Y.
    If the number is > 0, jump.

    It's not perfect but it should be a start.
  • HachikoHachiko Member Posts: 330
    ah, should have said this. Coordinate Y that must be saved is the one of the mouse.
Sign In or Register to comment.