Exemplo n.º 1
0
 public GameInterface(Texture2D back, SpriteFont font, Player player1, Player player2, Counter red, Counter blue, int count)
 {
     this.player1 = player1;
     this.player2 = player2;
     this.back = back;
     this.font = font;
     this.red = red;
     this.blue = blue;
     this.count = count;
 }
Exemplo n.º 2
0
 public Player(int x, int y, Texture2D texture, Controller.Controller control, Color color, Counter myCounter, Counter enemyCounter)
 {
     this.control = control;
     this.myCounter = myCounter;
     this.enemyCounter = enemyCounter;
     this.color = color;
     sprite = new AnimatedSprite(texture, 26, 26, 0.06f);
     sprite.AnimActive = false;
     this.x = x;
     this.y = y;
     GamePlayState.tiles[x, y].changeColor(color);
 }
Exemplo n.º 3
0
        public override void enter()
        {
            tiles = new Tile[size, size];

            bool[][] maze = LabirinthGenerator.generate(size);
            tiles = new Tile[size, size];
            for (int i = 0; i < size; i++)
                for (int j = 0; j < size; j++)
                    if(maze[i][j])
                        tiles[i, j] = new Tile(floorTex, Color.Gray,
                                        i*(ColorGame.HEIGHT - ColorGame.InterfaceHeight)/size + ColorGame.InterfaceWidth,
                                        j* (ColorGame.HEIGHT - ColorGame.InterfaceHeight) / size + ColorGame.InterfaceHeight, false);
                    else
                        tiles[i, j] = new Tile(wallTex, Color.White,
                                        i * (ColorGame.HEIGHT - ColorGame.InterfaceHeight) / size + ColorGame.InterfaceWidth,
                                        j * (ColorGame.HEIGHT - ColorGame.InterfaceHeight) / size + ColorGame.InterfaceHeight, true);
            tileCount = 0;
            countPlayableTiles();
            redCounter = new Counter();
            blueCounter = new Counter();
            redPlayer = new Player(0, 0, redPlayerTex, new KeyBoardController(), new Color(190,0,0), redCounter, blueCounter);
            bluePlayer = new Player(size - 1, size - 1, bluePlayerTex, new GamePadController(), new Color(0, 0, 190), blueCounter, redCounter);
            gameInterface = new GameInterface(interTex, font, redPlayer, bluePlayer, redCounter, blueCounter, tileCount);
            startTime = DateTime.Now;
        }