Ladder doensnt work

Discussion in 'Programming' started by Coolyo_Lars, Mar 17, 2019.

  1. Coolyo_Lars

    Coolyo_Lars Member

    Joined:
    Mar 16, 2019
    Posts:
    15
    I am trying to make a ladder but when i run the game i get: onLadder unknown variable.
    dont know what to do now. Can somebody help

    create event
    Code:
    onLadder=false;
    step event
    Code:
     
    //ladder
    
    //nog op ladder?
    if onLaddder == true && !place_meeting(x,y,oLadder)
        onLadder = false
    //op de ladder om omhoog te gaan
    if place_meeting(x,y,oLadder) && place_meeting(x,y+1,Blok)
        if keyboard_check(vk_up)
        onLadder = true
    //op de ladder voor omlaag
    if place_meeting(x,y+1,oLadder)
        if keyboard_check(vk_down)
        onLadder = true 
    //omhoogklimmen
    if onLadder == true && keyboard_check(vk_up){
        y=y-3
        if !place_meeting(x,y,oLadder) {
        onLadder = false
        while(!place_meeting(x,y+1, oLadder))
        y+=1
        }
    }
    //naar beneden klimmen
    if onLaddor == true && keyboard_check(vk_down){
    var wallId, itsOK;
    itsOK = false 
    wallId = instance_place(x,y+3,Blok)
    if wallId<0
        y+=3
    else {
        with wallId {
        itsOK = position_meeting(x,y,oLadder)
        }
        if itsOK == true
            y+=3
        else {
            while(!place_meeting(x,y,Blok))
            y+=1
        onLadder = false
        }
    }
    }
    [CODE]
     
  2. VagrantWhaleGames

    VagrantWhaleGames Member

    Joined:
    Jul 10, 2018
    Posts:
    58

    you're switching from laddor to ladder multiple times.
     
  3. Coolyo_Lars

    Coolyo_Lars Member

    Joined:
    Mar 16, 2019
    Posts:
    15
    OMG I am so stupid, thx.
    I now have my game running again. But stil cant use ladders any idea why?
     

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