public ArrayListGameObject childrenRecursive() { ArrayListGameObject childList = new ArrayListGameObject(); for (GameObject child : children) { childList.add(child); childList.addAll(child.childrenRecursive()); } return childList; }
public boolean hit() { for (GameObject g : touchingObjects) { if (!touchingObjectsLast.contains(g)) { return true; } } return false; }
public boolean hitComponent(String compName) { for (GameObject g : touchingObjects) { if (g.components.get(compName) != null && !touchingObjectsLast.contains(g)) return true; } return false; }
public boolean hitProperty(String propName) { for (GameObject g : touchingObjects) { if (g.props.containsKey(propName) && !touchingObjectsLast.contains(g)) return true; } return false; }
public boolean hit(String name) { for (GameObject g : touchingObjects) { if (g.name().equals(name) && !touchingObjectsLast.contains(g)) return true; } return false; }
public boolean touchingComponent(String compName) { return touchingObjects.getByComponent(compName) != null; }
public boolean touchingProperty(String propName) { return touchingObjects.getByProperty(propName) != null; }
public boolean touching(String name) { return touchingObjects.get(name) != null; }
public boolean touching() { return !touchingObjects.isEmpty(); }