Check rectangle overlap given bottom left corner, width, and height
Go to solution
Solved by Zalosath,
Ugh, solved.
public bool Overlaps(Room secondRoom) { bool condition1 = X2 - 1 > secondRoom.X1; bool condition2 = X1 < secondRoom.X2 - 1; bool condition3 = Y2 - 1 > secondRoom.Y1; bool condition4 = Y1 < secondRoom.Y2 - 1; return condition1 && condition2 && condition3 && condition4; }
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now