Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. int xMin = 0, xMax = this.width;
  2. int yMin = 0, yMax = this.height;
  3.  
  4. if (player.x <= xMin) {
  5. // Arguments go here for if object player has passed the left of the window border.
  6. } else if (player.y >= yMax) {
  7. // Arguments here for if object player is passing the bottom of the screen.
  8. }
  9.  
  10. if (object.position.X > window.width)
  11. {
  12. object.position.X = 0;
  13. }
  14. else if (object.position.X + object.sourceRect.Width < 0)
  15. {
  16. object.position.X = this.Width - object.sourceRect.Width;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement