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