@Override
    public void detectAndHandleCollisions(EntityGrid grid, CollisionHandler physics, float dt) {

        nearestEntity = grid.getNearest(this);

        if (physics.boxCollisionTest(this, nearestEntity)) {

            if (nearestEntity instanceof PlayerEntity) {
                handlePlayerIntersection((PlayerEntity) nearestEntity);
            } else if (nearestEntity instanceof BulletEntity) {
                handleBulletIntersection((BulletEntity) nearestEntity, physics);
            } else if (nearestEntity instanceof AsteroidEntity) {
                handleAsteroidIntersection((AsteroidEntity) nearestEntity, physics);
            }
        }

        if (isOutOfBounds(grid)) {
            handleOutOfBounds(grid);
        }
    }