示例#1
0
 public AlienShip(MatrixPosition topLeft, MatrixPosition speed)
     : base(topLeft, new char[, ] {
     { '@' }
 }, speed)
 {
     this.framesPerMove = 5;
 }
示例#2
0
 public Cursor(MatrixPosition topLeft)
     : base(topLeft, new char[, ] {
     { '>', '>' }
 })
 {
     this.isActive = false;
 }
示例#3
0
 public MovingObject(MatrixPosition topLeft, char[,] image, MatrixPosition speed)
     : base(topLeft, image)
 {
     this.currentFrame  = 0;
     this.framesPerMove = 1;
     this.Speed         = speed;
 }
示例#4
0
 public GiftPoints(MatrixPosition topLeft, MatrixPosition speed)
     : base(topLeft, new char[, ] {
     { '$' }
 }, speed)
 {
     this.framesPerMove = 5;
 }
示例#5
0
 public AlienMasterShip(MatrixPosition topLeft, MatrixPosition speed)
     : base(topLeft, speed)
 {
     base.image = new char[, ] {
         { '?' }
     };
     this.life = 2;
 }
示例#6
0
 public HiveShip(MatrixPosition topLeft, MatrixPosition speed)
     : base(topLeft, speed)
 {
     base.image = new char[, ] {
         { '&' }
     };
     this.life = 5;
 }
示例#7
0
 public DieHardAlien(MatrixPosition topLeft, MatrixPosition speed)
     : base(topLeft, speed)
 {
     base.image = new char[, ] {
         { '~' }
     };
     this.life = 3;
 }
示例#8
0
 protected PlayerShip(MatrixPosition topLeft)
     : base(topLeft, new char[, ] {
     { '^' }
 })
 {
     this.isShooting = false;
     this.life       = 3;
     this.Score      = 0;
 }
示例#9
0
        public static PlayerShip Instance(MatrixPosition position)
        {
            if (instance == null)
            {
                instance = new PlayerShip(position);
            }

            return(instance);
        }
示例#10
0
        protected GameObject(MatrixPosition topLeft, char[,] image)
        {
            this.TopLeft = topLeft;

            int imageRows = image.GetLength(0);
            int imageCols = image.GetLength(1);

            this.image = this.CopyImageMatrix(image);

            this.IsDestroyed = false;
        }
示例#11
0
        public GameInformation(MatrixPosition topLeft, string msg) : base(topLeft, new char[, ] {
            { 'a' }
        })
        {
            char[] msgArr = msg.ToCharArray();
            this.image = new char[1, msgArr.Length];
            for (int i = 0; i < msgArr.Length; i++)
            {
                this.image[0, i] = msgArr[i];
            }

            this.topLeft = topLeft;
        }
示例#12
0
        public void EnqueueForRendering(IRenderable obj)
        {
            char[,] objImage = obj.GetImage();

            int imageRows = objImage.GetLength(0);
            int imageCols = objImage.GetLength(1);

            MatrixPosition objTopLeft = obj.GetPosition();

            int lastRow = Math.Min(objTopLeft.Row + imageRows, this.renderContextMatrixRows);
            int lastCol = Math.Min(objTopLeft.Col + imageCols, this.renderContextMatrixCols);

            for (int row = obj.GetPosition().Row; row < lastRow; row++)
            {
                for (int col = obj.GetPosition().Col; col < lastCol; col++)
                {
                    if (row >= 0 && row < renderContextMatrixRows &&
                        col >= 0 && col < renderContextMatrixCols)
                    {
                        renderContextMatrix[row, col] = objImage[row - obj.GetPosition().Row, col - obj.GetPosition().Col];
                    }
                }
            }
        }
示例#13
0
 public Exit(MatrixPosition topLeft)
     : base(topLeft, message)
 {
 }
示例#14
0
 public Wall(MatrixPosition topLeft)
     : base(topLeft, new char[, ] {
     { '#' }
 })
 {
 }
示例#15
0
 public StartResume(MatrixPosition topLeft)
     : base(topLeft, message)
 {
 }
示例#16
0
        public override bool Equals(object obj)
        {
            MatrixPosition objAsMatrixCoords = obj as MatrixPosition;

            return(objAsMatrixCoords.Row == this.Row && objAsMatrixCoords.Col == this.Col);
        }
示例#17
0
 public Projectile(MatrixPosition topLeft, MatrixPosition speed)
     : base(topLeft, new char[, ] {
     { '|' }
 }, speed)
 {
 }
示例#18
0
 public Lifes(MatrixPosition topLeft, string msg)
     : base(topLeft, msg)
 {
 }
示例#19
0
 protected MenuItem(MatrixPosition topLeft, char[,] message)
     : base(topLeft, message)
 {
 }
示例#20
0
 public Score(MatrixPosition topLeft, string msg)
     : base(topLeft, msg)
 {
 }
示例#21
0
 public Gift(MatrixPosition topLeft, char[,] image, MatrixPosition speed)
     : base(topLeft, image, speed)
 {
     this.framesPerMove = 5;
 }