protected override void Initialize()
 {
     base.Initialize();
     collisionManager        = new CollisionManager();
     projectileSpriteFactory = new ProjectileSpriteFactory(this);
     projectileHandler       = new ProjectileHandler(this);
     link             = new Classes.Link(this);
     linkStateMachine = new LinkStateMachine(link);
     link.SetState(linkStateMachine);
     hudSpriteFactory   = new HudSpriteFactory(this);
     enemySpriteFactory = new EnemySpriteFactory(this);
     controllerList.Add(new CKeyboard(this));
     controllerList.Add(new CMouse(this));
     controllerList.Add(new ItemSelectionController(this));
     neighbors       = Parser.ParseNeighborCSV();
     roomList        = new List <Room>();
     util.roomNumber = util.startingRoomNumber();
     for (int i = 1; i < util.numberOfRooms() + 1; i++)
     {
         roomList.Add(Parser.ParseRoomCSV(this, i));
     }
     foreach (Room r in roomList)
     {
         if (r.getRoomNumber() == util.roomNumber)
         {
             currentRoom = r;
         }
     }
     currentRoom.Initialize();
     currentMainGameState = new MainState(this, currentRoom);
     currentGameState     = currentMainGameState;
     MediaPlayer.Play(song);
     MediaPlayer.IsRepeating = true;
 }
Exemple #2
0
 public playerHUD(ZeldaGame game, HudSpriteFactory hudFactory)
 {
     //general:
     this.game    = game;
     storage      = new HUDStorage(game);
     helper       = new HUDHelper(game);
     spriteScalar = game.util.hudScalar;
     HudFactory   = hudFactory;
     //---------------------------------------------------------------------------------------------------
     //sprite initialization:
     hudSprite       = HudFactory.baseHud();
     primWeapSprite  = HudFactory.primaryWeaponHUD();
     secWeapSprite   = HudFactory.secondaryWeaponHUD();
     gameLevelSprite = HudFactory.levelHUD();
     xSprite         = HudFactory.xHUD();
     top             = HudFactory.top();
     bottom          = HudFactory.bottom();
     right           = HudFactory.right();
     left            = HudFactory.left();
     //---------------------------------------------------------------------------------------------------
     //Position Initialization:
     X                = storage.HUD_Main_X;
     Y                = storage.HUD_Main_Y;
     hudPosition      = new Vector2(X, Y);
     primWeapPos      = storage.primaryWeaponPosition;
     secWeapPos       = storage.secondaryWeaponPosition;
     gameLevelPos     = storage.gameLevelPosition;
     heartPos         = storage.heartPosition;
     digitKeyPos      = storage.digitKeyPosition;
     KeyCounterPos    = storage.keyCountPosition;
     digitBombPos     = storage.digitBombPosition;
     BombCounterPos   = storage.bombCountPosition;
     digitYrupPos     = storage.digitYellowRuppeePosition;
     YellowCounterPos = storage.yellowruppeeCountPosition;
     xpPos            = storage.xpPosition;
     linkLevelPos     = storage.linkLevelPosition;
     minimapPos       = storage.minimapPosition;
     bossPos          = storage.bossPosition;
     linkIndicatorPos = storage.linkIndicatorPosition;
 }