Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (i = abs(hspd); i > 0; i -= 1;)
- {
- move_check = sign(hspd) * i;
- if !scr_findWall(x + move_check, y) {x += move_check; break;} //no collision on full speed so break the loop and move the instance
- //try to slide around corners
- if !scr_findWall(x + move_check, y - i) y -= (i / 2);
- if !scr_findWall(x + move_check, y + i) y += (i / 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement