Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Constructor for railcars
- public RailCar(int x, int y, int n) {
- railCartNumber=n;
- railCartXPos=x;
- railCartYPos=y;
- box= new Rectangle(BODY_WIDTH, BODY_HEIGHT, x, y);
- }
- //check method
- public boolean overlapsCheck(RailCar other){
- if (box.intersects(this.box)) {
- System.out.println("I say it overlaps!");
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement