GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Extended swipe down mechanic

RocketBrainRocketBrain Posts: 269Member, PRO
edited June 2016 in Working with GS (Mac)

I'm working on a platformer. I've input swipe movement (just up and down for now) using TShirtbooths swipe video, and it works fine.

In my game swiping up jumps, swiping down works kind of like the old mario crouching to slide under a brick. But i want the player to be able to control how long it stays down but possibly not releasing the swipe.

Any suggestions on how to modify the behaviors?

Comments

  • jonmulcahyjonmulcahy Posts: 10,383Member, Sous Chef

    @RocketBrain said:
    I'm working on a platformer. I've input swipe movement (just up and down for now) using TShirtbooths swipe video, and it works fine.

    In my game swiping up jumps, swiping down works kind of like the old mario crouching to slide under a brick. But i want the player to be able to control how long it stays down but possibly not releasing the swipe.

    Any suggestions on how to modify the behaviors?

    I don't know how his demo worked, but can you add a condition to the rule that checks if mouse A is down, which should always be true if the screen is touched. You can also play around with the other touch triggers.

    if you can post a screenshot of the crouch rule it would help

  • RocketBrainRocketBrain Posts: 269Member, PRO
    edited June 2016

    I ended up throwing out his system in my case as it made it really complicated (in my opinion). Right now i'm only dealing with the Y-Axis, i might add X-Axis later, dunno yet.

    What i ended up doing is:

    in the control actor:

    When touch = pressed
    change First.Y = Device.Touch.Y
    after 0.1s change New.Y=Device.Touch.Y

    then over in the player

    If New.Y > First.Y
    change linear.velocity.y = 400

    If New.Y < First.Y
    change player.height = 32 (half the normal height)
    constrain rotation=0 (keeps it from turning into a wobbly rotating thingy)

    I was having trouble with it squatting when you started jumping when i only wanted jump so i constrained a distance with magnitude and threw it in the jump behavior if dist>10 to keep it from doing that.

    further benefit, this system allowed me to make the character squish while in the air. :smile:

Sign In or Register to comment.