示例#1
0
        public GameController(int windowX, int windowY)
        {
            //game controller will keep track of
            //player, enemies, score, items.
            player = new Player(3);
            diffContext = new DifficultyContext(player.PlayerScore);
            player.PlayerScore.register(diffContext);
            spawner = new SpawnerProto(windowX,windowY);

            enemiesVector = new List<Vector2>();
            enemiesOnScreen = new List<EnemySubclass>();

            notification = "";

            windowHeight = windowY;
            windowWidth = windowX;

            items = new ItemManager();
            itemAppeared = false;

            elapsedTime = 0;
        }
示例#2
0
        /// <summary>
        /// Method to reset variables for a new game
        /// </summary>
        public void startNewGame()
        {
            player.newGame(3);

            //clear enemies vector list and enemy list
            enemiesVector.Clear();
            enemiesOnScreen.Clear();

            //clear notification string
            notification = "";

            //reinstantiate itemManager
            items = new ItemManager();
            itemAppeared = false;

            elapsedTime = 0;
        }