Пример #1
0
 public ItemSelectState(ZeldaGame game)
 {
     this.storage = new ItemSelectStateStorage();
     this.game    = game;
     game.spriteSheets.TryGetValue("HUD", out inventorySpriteSheet);
     HudFactory       = game.hudSpriteFactory;
     top              = new UniversalSprite(game, inventorySpriteSheet, storage.topRectangle, Color.White, SpriteEffects.None, new Vector2(1, 1), storage.fpsLimiter, itemDepth);
     mid              = new UniversalSprite(game, inventorySpriteSheet, storage.midRectangle, Color.White, SpriteEffects.None, new Vector2(1, 1), storage.fpsLimiter, itemDepth);
     holdingMap       = new UniversalSprite(game, inventorySpriteSheet, storage.mapRectangle, Color.White, SpriteEffects.None, new Vector2(1, 1), storage.fpsLimiter, itemDepth);
     holdingCompass   = new UniversalSprite(game, inventorySpriteSheet, storage.compassRectangle, Color.White, SpriteEffects.None, new Vector2(1, 1), storage.fpsLimiter, itemDepth);
     pHUD             = game.currentRoom.pHUD;
     secweaponHolding = HudFactory.blankBox();
     secweaponOne     = HudFactory.blankBox();
     secweaponTwo     = HudFactory.blankBox();
     secweaponThree   = HudFactory.blankBox();
 }
Пример #2
0
        void IGameState.Update()
        {
            pHUD = game.currentRoom.pHUD;
            pHUD.Update();
            game.util.inSelect = true;
            if (game.util.selectSpeed < 0)
            {
                if (pHUD.hudPosition.Y > storage.hudTopPos)
                {
                    ItemScreenPositionalUpdate(game.util.selectSpeed);
                }
                else
                {
                    game.currentGameState = game.currentMainGameState; game.util.inSelect = false;
                }
            }
            else
            {
                if (pHUD.hudPosition.Y < storage.hudBotPos)
                {
                    ItemScreenPositionalUpdate(game.util.selectSpeed);
                }
            }
            game.controllerList[0].Update();
            game.controllerList[2].Update();
            secweaponHolding = HudFactory.secondaryWeaponHUD();
            switch (game.link.linkState.weaponSelected)
            {
            case LinkStateMachine.Weapon.bomb:
                secweaponOne = HudFactory.blankBox();
                secweaponTwo = HudFactory.staticBoomerang();
                if (game.util.hasBow)
                {
                    secweaponThree = HudFactory.staticBow();
                }
                else
                {
                    secweaponThree = HudFactory.blankBox();
                }
                break;

            case LinkStateMachine.Weapon.boomerang:
                secweaponOne = HudFactory.staticBomb();
                secweaponTwo = HudFactory.blankBox();
                if (game.util.hasBow)
                {
                    secweaponThree = HudFactory.staticBow();
                }
                else
                {
                    secweaponThree = HudFactory.blankBox();
                }
                break;

            case LinkStateMachine.Weapon.arrow:
                secweaponOne = HudFactory.staticBomb();
                secweaponTwo = HudFactory.staticBoomerang();
                if (game.util.hasBow)
                {
                    secweaponThree = HudFactory.blankBox();
                }
                break;

            default:
                break;
            }
        }