Here you can find the source of isInCollision(Rectangle boundedBoxPlayer, Rectangle boundedBoxObject)
public static boolean isInCollision(Rectangle boundedBoxPlayer, Rectangle boundedBoxObject)
//package com.java2s; //License from project: Open Source License import java.awt.Rectangle; public class Main { public static boolean isInCollision(Rectangle boundedBoxPlayer, Rectangle boundedBoxObject) { boolean collided = false; if (boundedBoxObject.intersects(boundedBoxPlayer)) collided = true;/*from ww w . jav a2 s.c om*/ return collided; } }