private void MakeShoot() { if (GameRandom.RandNumber(0, 64) == 0 && Ammo > 0) { Ammo--; var shell = new Shell(GUIForm, this); shell.Subscribe(); InvokeShot(new ShellEventArgs(shell)); } }
public override void SetNewStageParameters() { MoveToStartPosition(); Direction = Direction.Down; Lives = 0; Stars = GameRandom.RandNumber(0, 3); Immortal = false; Amphibian = false; Gun = false; MoveTimer.Stop(); RespawnTimer.Start(); }
private void Rotate() { if (GameRandom.RandNumber(0, 1) == 0) { ChangeDirection(); } else if (GameRandom.RandNumber(0, 1) == 0) { RotateClockwise(); } else { RotateAnticlockwise(); } }
private void CheckTileReach() { if (Rect.X % 64 == 0 && Rect.Y % 64 == 0 && GameRandom.RandNumber(0, 64) == 0) { ChangeDirection(); } else if (Dx == 0 && Dy == 0 && GameRandom.RandNumber(0, 16) == 0) { if (Rect.X % 64 != 0 || Rect.Y % 64 != 0) { InvertDirection(); } else { Rotate(); } } }
protected override void MoveToStartPosition() { switch (GameRandom.RandNumber(1, 3)) { case 1: Rect = new Rectangle(64, 64, 64, 64); break; case 2: Rect = new Rectangle(448, 64, 64, 64); break; case 3: Rect = new Rectangle(832, 64, 64, 64); break; default: break; } }
public void ChangeDirection() { Direction = (Direction)GameRandom.RandNumber(0, 3); }
private void MoveToNewPosition() { Rect = new Rectangle(64 + GameRandom.RandNumber(0, 24) * 32, 64 + GameRandom.RandNumber(0, 24) * 32, 64, 64); }
private void GenerateRandomBonus() { CurrentBonus = _bonuses[GameRandom.RandNumber(0, _bonuses.Count - 1)]; }