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