예제 #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;
 }