Пример #1
0
    private void MoveShot()
    {
        QRegion region = new QRegion(ShotRect());

        timerCount++;

        QRect shotR = ShotRect();

        if (shotR.Intersects(TargetRect()))
        {
            autoShootTimer.Stop();
            Emit.Hit();
            Emit.CanShoot(true);
        }
        else if (shotR.X() > Width() || shotR.Y() > Height() ||
                 shotR.Intersects(BarrierRect()))
        {
            autoShootTimer.Stop();
            Emit.Missed();
            Emit.CanShoot(true);
        }
        else
        {
            region = region.Unite(shotR);
        }

        Update(region);
    }
Пример #2
0
    private void moveShot()
    {
        QRegion region = new QRegion(shotRect());

        timerCount++;

        QRect shotR = shotRect();

        if (shotR.Intersects(targetRect()))
        {
            autoShootTimer.Stop();
            Emit.hit();
            Emit.canShoot(true);
        }
        else if (shotR.X() > Width() || shotR.Y() > Height())
        {
            autoShootTimer.Stop();
            Emit.missed();
            Emit.canShoot(true);
        }
        else
        {
            region = region.Unite(new QRegion(shotR));
        }

        Update(region);
    }
Пример #3
0
    private void moveShot()
    {
        QRegion region = new QRegion(shotRect());

        timerCount++;

        QRect shotR = shotRect();

        if (shotR.X() > Width() || shotR.Y() > Height())
        {
            autoShootTimer.Stop();
        }
        else
        {
            region = region.Unite(new QRegion(shotR));
        }
        Update(region);
    }