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