Cleaner walljumping code
public text v1 · immutablewj = 0
if place_free(x,y +1)
{
gravity_direction = 270
gravity = 0.5
if !place_free(x+move_speed,y)
{
if move_speed>0
{
wj = 1
}
else
{
wj = 2
}
}
}
else
{
gravity = 0
}
if place_free(x +move_speed,y)
{
x = x +move_speed
}
if !keyboard_check(vk_left) and !keyboard_check(vk_right) and wj = 0
{
sprite_index = spr_b_1
move_speed-=1*sign(move_speed)
}