I am making the Rush Hour Game. I have all my rectangles (cars) set up and they can be dragged about on the board horizontally or vertically on the board depending on their orientation. My problem which I'm having now is setting up collision detection.
Am I right in thinking that because i'm using x and y coordinates to define where each car is placed on the board that i can use the intersects method ie.
public boolean intersects(Rectangle rect)
or am I going down the wrong path here?
If its the right path then I have 8 cars so I guess I would use a for loop to make sure that car selected to be moved does not collide with any other car on the board - is this correct?
Any tips/pointers you can give me would be much appreciated. Below is my three classes that i have just now to get the game to stage of setting up the collision detection.
Thanks