private void moveShot() { QRegion region = new QRegion(shotRect()); timerCount++; QRect shotR = shotRect(); if (shotR.Intersects(targetRect())) { autoShootTimer.Stop(); Emit.hit(); } else if (shotR.X() > Width() || shotR.Y() > Height()) { autoShootTimer.Stop(); Emit.missed(); } else { region = region.Unite(new QRegion(shotR)); } Update(region); }
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); }