Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Horizontal collision
- if place_meeting(x + hsp, y, obj_wall)
- {
- while !place_meeting(x + sign(hsp), y, obj_wall)
- {
- x += sign(hsp);
- }
- hsp = 0;
- }
- x += hsp;
- //Vertical collision
- if place_meeting(x, y + vsp, obj_wall)
- {
- while !place_meeting(x, y + sign(vsp), obj_wall)
- {
- y += sign(vsp);
- }
- vsp = 0;
- }
- y += vsp;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement