private GameManager()
        {
            labyrinth = new Labyrinth();
            policeHouseTiles = new List<Vector2>();

            policeHouseTiles.Add(new Vector2(6, 0));
            policeHouseTiles.Add(new Vector2(7, 0));
            policeHouseTiles.Add(new Vector2(0, 4));
            policeHouseTiles.Add(new Vector2(0, 5));
            policeHouseTiles.Add(new Vector2(6, 9));
            policeHouseTiles.Add(new Vector2(7, 9));
            policeHouseTiles.Add(new Vector2(13, 4));
            policeHouseTiles.Add(new Vector2(13, 5));

            countDowns = new List<Countdown>();
            newCountDowns = new List<Countdown>();

            characters = new List<Character>();
            charactersToDelete = new List<Character>();
            charactersToCreate = new List<Character>();
            countDownsToDelete = new List<Countdown>();

            Countdown firstTrapCountDown = new Countdown(0, 0, 30 - level, Subject.NotifyReason.SPAWN_NEW_TRAP);
            firstTrapCountDown.AddObserver(this);
            countDowns.Add(firstTrapCountDown);
            Countdown firstPowerupCountDown = new Countdown(0, 0, 25 - level, Subject.NotifyReason.SPAWN_NEW_POWERUP);
            firstPowerupCountDown.AddObserver(this);
            countDowns.Add(firstPowerupCountDown);

            collectibles = new List<Collectible>();
            collectiblesToDelete = new List<Collectible>();
            collectiblesToCreate = new List<Collectible>();

            level = 1;

            gru = (PlayerCharacter)CharacterFactory.CreateCharacter(CharacterFactory.CharacterType.GRU, new Vector2(labyrinth.GetTile(DEPART_X, DEPART_Y).GetPosition().X, labyrinth.GetTile(DEPART_X, DEPART_Y).GetPosition().Y), labyrinth.GetTile(DEPART_X, DEPART_Y));
            characters.Add(gru);
            gru.AddObserver(this);

            StartGame();

            shouldStartGame = false;

            //Teleporter entrance
            warpEntreePos = new Vector2(labyrinth.GetTile(7, 4).GetPosition().X - Tile.LIGN_SIZE, labyrinth.GetTile(7, 4).GetPosition().Y + Tile.LIGN_SIZE);

            //Teleporter exits
            warpExitsPos[0] = new Vector2(labyrinth.GetTile(0, 0).GetPosition().X, labyrinth.GetTile(0, 0).GetPosition().Y);
            warpExitsPos[1] = new Vector2(labyrinth.GetTile(Labyrinth.WIDTH - 1, 0).GetPosition().X, labyrinth.GetTile(Labyrinth.WIDTH - 1, 0).GetPosition().Y);
            warpExitsPos[2] = new Vector2(labyrinth.GetTile(0, Labyrinth.HEIGHT - 1).GetPosition().X, labyrinth.GetTile(0, Labyrinth.HEIGHT - 1).GetPosition().Y);
            warpExitsPos[3] = new Vector2(labyrinth.GetTile(Labyrinth.WIDTH - 1, Labyrinth.HEIGHT - 1).GetPosition().X, labyrinth.GetTile(Labyrinth.WIDTH - 1, Labyrinth.HEIGHT - 1).GetPosition().Y);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DespicableGame"/> class.
 /// </summary>
 public DespicableGame()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     labyrinth = new Labyrinth();
 }
 public ConfusedGhostMinion(Texture2D drawing, Vector2 position, Tile actualTile, Labyrinth lab)
     : base(drawing, position, actualTile)
 {
     labyrinth = lab;
     Destination = AIMovement(actualTile);
 }