Ejemplo n.º 1
0
 private void MakeShoot()
 {
     if (GameRandom.RandNumber(0, 64) == 0 && Ammo > 0)
     {
         Ammo--;
         var shell = new Shell(GUIForm, this);
         shell.Subscribe();
         InvokeShot(new ShellEventArgs(shell));
     }
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 private void Rotate()
 {
     if (GameRandom.RandNumber(0, 1) == 0)
     {
         ChangeDirection();
     }
     else if (GameRandom.RandNumber(0, 1) == 0)
     {
         RotateClockwise();
     }
     else
     {
         RotateAnticlockwise();
     }
 }
Ejemplo n.º 4
0
 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();
         }
     }
 }
Ejemplo n.º 5
0
        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;
            }
        }
Ejemplo n.º 6
0
 public void ChangeDirection()
 {
     Direction = (Direction)GameRandom.RandNumber(0, 3);
 }
Ejemplo n.º 7
0
 private void MoveToNewPosition()
 {
     Rect = new Rectangle(64 + GameRandom.RandNumber(0, 24) * 32, 64 + GameRandom.RandNumber(0, 24) * 32, 64, 64);
 }
Ejemplo n.º 8
0
 private void GenerateRandomBonus()
 {
     CurrentBonus = _bonuses[GameRandom.RandNumber(0, _bonuses.Count - 1)];
 }