Esempio n. 1
0
 /*
  * Loads the specified level
  */
 public void LoadLevel(ContentFactory factory, GameUnitController unit_controller, 
     ItemController item_controller, int level_num)
 {
     CurLevel = factory.loadLevel(level_num);
     item_controller.Reset();
     unit_controller.Reset();
     unit_controller.SetLevel(CurLevel);
 }
Esempio n. 2
0
        public GameUnitController(ContentFactory factory)
        {
            this.factory = factory;
            Units = new List<GameUnit>();
            DeadUnits = new List<GameUnit>();
            ConvertedUnits = new List<GameUnit>();
            lostUnits = new List<GameUnit>();

            rand = new Random();
            Player = factory.createPlayer(new Vector2(0, 0));
        }
Esempio n. 3
0
 /*
  * Reloads the current level
  */
 public void ResetLevel(ContentFactory factory, GameUnitController unit_controller,
     ItemController item_controller)
 {
     LoadLevel(factory, unit_controller, item_controller, CurLevelNum);
 }
Esempio n. 4
0
 /// <summary>
 /// Load all default graphics resources for the canvas
 /// </summary>
 /// <param name='content'>
 /// Reference to global content manager.
 /// </param>
 public void LoadContent(ContentFactory factory)
 {
     // Load sprite font
     font = factory.getFont();
 }
Esempio n. 5
0
 public GameEngine()
 {
     canvas = new GameCanvas(this);
     factory = new ContentFactory(new ContentManager(Services));
     camera = new Camera(canvas.Width, canvas.Height);
 }