GameSalad

Howdy, Stranger!

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

Jumping at an angle

butterbeanbutterbean Posts: 4,315Member, PRO
edited 4:24PM in Working with GS (Mac)
How do I program my main character to jump at an angle, and not straight up if the left or right key is held down with the jump key?

Comments

  • KamazarKamazar Posts: 287Member
    If space bar and right key are down, accelerate in direction 135... ?
  • TobyToby Posts: 478Member
    yep that works
  • butterbeanbutterbean Posts: 4,315Member, PRO
    So I created a game attribute boolean, called self on the ground

    When the player jumps straight up using the spacebar, she can only jump once

    When I put in a rule for her to jump at an angle, here's how I did it:

    When all conditions are valid:

    Actor receives event: Key, Space is down
    " " : Right Keyboard is down

    Change attribute:

    Self on the ground to : False

    Timer: For .5 seconds Run to completion is checked

    move direction: 28 relative to actor Move type: Additive

    Speed: 175

    Now what happens is when I hit the right and spacekey, she keeps jumping almost like she's triple jumping or floating, so she will keep jumping up to the right instead of landing on the ground, and resetting the jump

    How do I fix this?

    Thanks!
  • butterbeanbutterbean Posts: 4,315Member, PRO
    Anyone? :)
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
This discussion has been closed.