Example #1
0
        public void Move(int[,] grid)
        {
            int move = 0;

            Random rng = new Random();

            int ch = rng.Next(0, 4);

            switch(ch)
            {
                case 0:
                    move = 1;
                    break;
                case 1:
                    move = -1;
                    break;
                case 2:
                    move = 2;
                    break;
                case 3:
                    move = -2;
                    break;
            }
            this.RemoveFromGrid(grid);

            if (move == 1) { this.core = new Coordinates(core.x, core.y - 1); }
            if (move == -1) { this.core = new Coordinates(core.x, core.y + 1); }
            if (move == 2) { this.core = new Coordinates(core.x-1, core.y); }
            if (move == -2) { this.core = new Coordinates(core.x+1, core.y); }

            this.UpdateBits();

            this.PlaceInGrid(grid);
        }
Example #2
0
        public void TimeProgress(int[,] grid)
        {
            this.RemoveFromGrid(grid);

            this.core = new Coordinates(core.x + direction, core.y);

            this.PlaceInGrid(grid);
        }
Example #3
0
        public HeroV2(int pos1,int pos2, int l)
        {
            this.core = new Coordinates(pos1, pos2);
            lives = l;

            bits.Add(this.core);
            bits.Add(new Coordinates(pos1, pos2 + 1));
            bits.Add(new Coordinates(pos1+1, pos2 + 1));
            bits.Add(new Coordinates(pos1+1, pos2));
        }
Example #4
0
        public Boss(int pos1,int pos2, int l)
        {
            this.core = new Coordinates(pos1, pos2);
            lives = l;

            bits.Add(this.core);
            // plus shape
            bits.Add(new Coordinates(pos1+1, pos2));
            bits.Add(new Coordinates(pos1-1, pos2));
            bits.Add(new Coordinates(pos1, pos2-1));
            bits.Add(new Coordinates(pos1, pos2 +1));
        }
Example #5
0
        public void Move(int move, int[,] grid)
        {
            this.RemoveFromGrid(grid);

            if (move == 1) { this.core = new Coordinates(core.x, core.y - 1); }
            if (move == -1) { this.core = new Coordinates(core.x, core.y + 1); }
            if (move == 2) { this.core = new Coordinates(core.x-1, core.y); }
            if (move == -2) { this.core = new Coordinates(core.x+1, core.y); }

            this.UpdateBits();

            this.PlaceInGrid(grid);
        }
Example #6
0
 public ProjectileV2(int xpos, int ypos, int d, int d2 = 0)
 {
     this.core = new Coordinates(xpos, ypos);
     direction = d;
 }