Exemplo n.º 1
0
 public void MoveLeft()
 {
     if (this.TopLeft.Col <= AimSize)
     {
         this.TopLeft = new MatrixCoords(this.TopLeft.Row, 1);
     }
     else
     {
         this.TopLeft = new MatrixCoords(this.TopLeft.Row, this.TopLeft.Col - Step);
     }
 }
Exemplo n.º 2
0
 public void MoveDown()
 {
     if (this.TopLeft.Row >= Constants.WorldRows - 1 - (2 * AimSize))
     {
         this.TopLeft = new MatrixCoords(Constants.WorldRows - 1 - AimSize, this.TopLeft.Col);
     }
     else
     {
         this.TopLeft = new MatrixCoords(this.TopLeft.Row + Step, this.TopLeft.Col);
     }
 }
Exemplo n.º 3
0
 public void MoveRight()
 {
     if (this.TopLeft.Col >= (Constants.WorldCols * Constants.LeftRightScreenRatio) - (2 * AimSize))
     {
         this.TopLeft = new MatrixCoords(
             this.TopLeft.Row,
             (int)(Constants.WorldCols * Constants.LeftRightScreenRatio) - AimSize);
     }
     else
     {
         this.TopLeft = new MatrixCoords(this.TopLeft.Row, this.TopLeft.Col + Step);
     }
 }
Exemplo n.º 4
0
        public MatrixCoords GetRandomMatrixCoords()
        {
            var position = new MatrixCoords(random.Next(1, Constants.WorldRows - 1), random.Next(1, (int)(Constants.WorldCols * Constants.LeftRightScreenRatio)));

            while (this.gameObjects.Any(go => go.TopLeft == position))
            {
                position = new MatrixCoords(random.Next(1, Constants.WorldRows - 1), random.Next(1, (int)(Constants.WorldCols * Constants.LeftRightScreenRatio)));
            }

            return position;
        }
Exemplo n.º 5
0
 public void MoveUp()
 {
     if (this.TopLeft.Row <= AimSize)
     {
         this.TopLeft = new MatrixCoords(1, this.TopLeft.Col);
     }
     else
     {
         this.TopLeft = new MatrixCoords(this.TopLeft.Row - Step, this.TopLeft.Col);
     }
 }
 protected GameObject(MatrixCoords topLeft)
 {
     this.TopLeft = topLeft;
     this.IsDestroyed = false;
 }
Exemplo n.º 7
0
        private MatrixCoords GetRandomMatrixCoords()
        {
            var position = new MatrixCoords(random.Next(1, Constants.WorldRowsWPF - 1), random.Next(1, (int)(Constants.WorldColsWPF)));
            while (this.gameObjects.Any(go => go.TopLeft == position))
            {
                position = new MatrixCoords(random.Next(1, Constants.WorldRowsWPF - 1), random.Next(1, (int)(Constants.WorldColsWPF)));
            }

            return position;
        }
Exemplo n.º 8
0
 protected GameObject(MatrixCoords topLeft)
 {
     this.TopLeft     = topLeft;
     this.IsDestroyed = false;
 }