Java Rectangle Bounds isInCollision(Rectangle boundedBoxPlayer, Rectangle boundedBoxObject)

Here you can find the source of isInCollision(Rectangle boundedBoxPlayer, Rectangle boundedBoxObject)

Description

is In Collision

License

Open Source License

Declaration

public static boolean isInCollision(Rectangle boundedBoxPlayer,
            Rectangle boundedBoxObject) 

Method Source Code

//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;
    }
}

Related

  1. getBoundsInAncestor(Container ancestor, final Component comp, Rectangle bounds)
  2. getCenteredBoundsOn(Rectangle srcBounds, int width, int height)
  3. getLocalBounds(Component aComponent)
  4. getLocalBounds(Rectangle bounds, Container c)
  5. getRectangleListBounds(Vector vctRectangles)
  6. setBounds(Container container, Component component, Rectangle bounds)
  7. setBounds(java.awt.Rectangle hole, int xA, int yA, int xB, int yB)
  8. storeWindowBounds(java.awt.Window window, java.util.prefs.Preferences prefs)