@Override
    public void tick(){
        double vx = 0.0;
        double vy = 0.0;

        if(xVel == -1){
            vx = -1.0;
            xOffset--;
        }else if (xVel == 1){
            vx = 1.0;
            xOffset++;
        }
        if(xOffset == xLimit){
            xOffset = xLimit;
            xVel = -xVel;
            xLimit = rand.nextInt(50) * xVel;
        }
        if (vx != 0 || vy != 0) {
            Vec2 vel = new Vec2(vx, vy);
            vel.normalize();
            vel.scale(3.0);

            move(vel.x, vel.y);
        }
        move(0, 5.0);

        if (shootDelay > 0)
            shootDelay--;
        if (shootDelay == 0) {
            shootDelay = shootCooldown;
            fireBullet();
        }

        super.tick();
    }