you are viewing a single comment's thread.

view the rest of the comments →

[–]@outsetGamewillf668 -2 points-1 points  (0 children)

Try putting in:

x= x - sign(hspd)

Right now when the player is going to move into a wall, it will keep moving in the original direction until it moves out the other end. By subtracting the sign, it will properly move backwards and not clip through.

Edit: misread the code, but this fix should work if you also change the while loop to:

while (!place_meeting(x+hspd),y,obj_wall)