Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (box1.x < box2.x + box2.width &&
- box1.x + box1.width > box2.x &&
- box1.y < box2.y + box2.height &&
- box1.height + box1.y > box2.y) {
- // collision detected!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement