Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int xMin = 0, xMax = this.width;
- int yMin = 0, yMax = this.height;
- if (player.x <= xMin) {
- // Arguments go here for if object player has passed the left of the window border.
- } else if (player.y >= yMax) {
- // Arguments here for if object player is passing the bottom of the screen.
- }
- if (object.position.X > window.width)
- {
- object.position.X = 0;
- }
- else if (object.position.X + object.sourceRect.Width < 0)
- {
- object.position.X = this.Width - object.sourceRect.Width;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement