示例#1
0
 /**
  * 查找指定位置的精灵对象
  *
  * @param x
  * @param y
  * @return
  */
 public synchronized ISprite find(int x, int y) {
   ISprite[] snapshot = sprites;
   for (int i = snapshot.length - 1; i >= 0; i--) {
     ISprite child = snapshot[i];
     RectBox rect = child.getCollisionBox();
     if (rect != null && rect.contains(x, y)) {
       return child;
     }
   }
   return null;
 }