@Override
    public void tick(float dt) {
        this.totalTime += dt;
        this.lastShot += dt;

        boolean shouldReverse = false;
        ListIterator it = invaders.listIterator();
        boolean fired = false;
        while(it.hasNext()) {
            InvaderEnemy invader = (InvaderEnemy)it.next();
            if(invader.isDestroyed()) {
                it.remove();
            }
            else {
                Rect2 bounds = invader.getBounds();
                double rand = Math.abs(Utils.random.nextGaussian()) * 1000.0;
                if(lastShot > TIME_BETWEEN_SHOTS && rand < FIRE_CHANCE) {
                    fired = true;
                    invader.handleMessage(InvaderEnemy.FIRE);
                }
                if(bounds.getLeft() <= 0.0f) {
                    shouldReverse = true;
                    break;
                }
                else if(bounds.getRight() >= Game.windowWidth) {
                    shouldReverse = true;
                    break;
                }
            }
        }
        if(fired) {
            lastShot = 0.0f;
        }
        if(shouldReverse) {
            for(InvaderEnemy invader : invaders) {
                invader.handleMessage(InvaderEnemy.REVERSE_DIRECTION);
            }
        }
    }