/** Calculates if a GameObject is outside the world or not. */ private void calculateOutsideWorld(GameObject go) { if (go instanceof MoveableGameObject) { if (!go.isActive()) { return; } if (go.getX() - go.getFrameWidth() < 0 || go.getX() > mapWidth || go.getY() - go.getFrameHeight() < 0 || go.getY() > mapHeight) { ((MoveableGameObject) go).outsideWorld(); } } }