1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

[SOLVED] wall jumping

Discussion in 'Programming' started by Abobey, Sep 2, 2019.

Tags:
  1. Abobey

    Abobey Member

    Joined:
    Sep 1, 2019
    Posts:
    10
    Hi guys so I don't know if I need to learn more about what each function and variables do in GML before trying to create my own code but I'm trying to create a wall jump mechanism I tried this code but it does not work
    if (key_jump) && (place_meeting(x+1,y,oWall)) && place_meeting(x-1,y,oWall) {
    jumps = 1;
    }

    i figured it out thanks to @FrostyCat heres the code if you want to use it

    if (place_meeting(x+1,y,oWall)) - (place_meeting(x-1,y,oWall)) and (key_jump)
    {
    vsp = -7.5;
    }
     
    Last edited: Sep 2, 2019
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,601
    Read the code aloud to yourself. You should immediately hear something absurd about it, and if you have any common sense, also know how to fix it.

    This is what your code reads: If the jumping key is pressed AND there's a wall to my right AND there's a wall to my left, start jumping.
     
    Abobey likes this.
  3. Abobey

    Abobey Member

    Joined:
    Sep 1, 2019
    Posts:
    10
    oh i see what you mean...
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice