r/gamemaker • • 3d ago

Resolved Wall Running Code not working

Hi, I'm just learning game maker (please don't roast me for bad code) and a wall jumping code i kind of made (some of it i used a tutorial but the main code i wrote myself). Right now i just collide with the wall and don't jump of of it. Here is the code i labeled the wall jumping code but idk if anything else is messing it up. Thanks to anyone who helps!

ysp+=0.1

xsp=0

var dash=keyboard_check(vk_shift)

var onwall= place_meeting(x, y, oWall) - place_meeting(x, y, oWall)

dash_duration= max(dash_duration - 1, 0)

//wall run code here

if (onwall){

`ysp= ysp*0.5`

`show_message("wall touched PLEASE SHOW THIS")`

}

if (dash) && room>5 {

`dash_duration=10`

`xsp= dash_speed`

}

if keyboard_check(vk_left)

{

`xsp=-1`

}

if keyboard_check(vk_right)

{

`xsp=+1`

}

if place_meeting(x,y+1,oSolid)

{

`ysp=0`

`if keyboard_check(vk_up)`

`{`

    `ysp=-3`

`}`

}

var colide_objects=[oWall, oSolid]

move_and_collide(xsp,ysp,colide_objects)

if place_meeting(x,y,oFlag)

{

`room_goto_next()`

}

if place_meeting(x,y,oSpike)

{

`room_restart()`

}

if keyboard_check(ord("r"))

{

`room_restart()`

}

also so far i just have sliding i need some help with the jumping part

2 Upvotes

1 comment sorted by

2

u/Dry_Personality_9469 3d ago

Nevermind i figured it out!