Advertisement
Guest User

Untitled

a guest
Jan 25th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. for (i = abs(hspd); i > 0; i -= 1;)
  2. {
  3. move_check = sign(hspd) * i;
  4. if !scr_findWall(x + move_check, y) {x += move_check; break;} //no collision on full speed so break the loop and move the instance
  5. //try to slide around corners
  6. if !scr_findWall(x + move_check, y - i) y -= (i / 2);
  7. if !scr_findWall(x + move_check, y + i) y += (i / 2);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement