예제 #1
0
 public Link(Game1 game, LinkSprite sprite, Vector2 spawn)
 {
     Game     = game;
     Sprite   = sprite;
     Position = spawn;
     Sprite.UpdatePosition(spawn);
     Sprite.ChangeSpriteAnimation("WalkUp");
     directionName = "Up";
     StateMachine  = new LinkStateMachine(game, this);
     Game.soundEffects[8].Play();
 }
예제 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>

        protected override void LoadContent()
        {
            // Sprites
            spriteBatch = new SpriteBatch(GraphicsDevice);

            LinkSpriteSheet    = Content.Load <Texture2D>("Link Sprite Sheet");
            MonsterSpriteSheet = Content.Load <Texture2D>("Monster Sprite Sheet");
            ItemSpriteSheet    = Content.Load <Texture2D>("Item Sprite SHeet");
            EffectSpriteSheet  = Content.Load <Texture2D>("Effects Sprite Sheet");
            TileSpriteSheet    = Content.Load <Texture2D>("Tile Sprite Sheet");
            InventoryScreen    = Content.Load <Texture2D>("HUD");

            // Dungeon
            DungeonMain       = Content.Load <Texture2D>("Dungeon1_Main");
            DungeonDoorFrames = Content.Load <Texture2D>("Dungeon1_Door_Frames");

            /*
             * addes sound Effects
             * 0.LOZ_Arrow_Boomerang
             * 1 LOZ_Bomb_Blow
             * 2 LOZ_Bomb_Drop
             * 3 LOZ_Boss_Scream1
             * 4 LOZ_Candle
             * 5 LOZ_Door_Unlock
             * 6 LOZ_Enemy_Die
             * 7 LOZ_Enemy_Hit
             * 8 LOZ_Fanfare
             * 9 LOZ_Get_Heart
             * 10 LOZ_Get_Item
             * 11 LOZ_Get_Rupee
             * 12 LOZ_Key_Appear
             * 13 LOZ_Link_Die
             * 14 LOZ_Link_Hurt
             * 15 LOZ_LowHealth
             * 16 LOZ_Secret
             * 17 LOZ_Sword_Shoot
             * 18 LOZ_Sword_Slash
             * 19 LOZ_Gunshot
             */
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Arrow_Boomerang"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Bomb_Blow"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Bomb_Drop"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Boss_Scream1"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Candle"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Door_Unlock"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Enemy_Die"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Enemy_Hit"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Fanfare"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Get_Heart"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Get_Item"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Get_Rupee"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Key_Appear"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Link_Die"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Link_Hurt"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_LowHealth"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Secret"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Sword_Shoot"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Sword_Slash"));
            soundEffects.Add(Content.Load <SoundEffect>("LOZ_Gunshot"));


            SpriteLink = new LinkSprite(this, "WalkUp", LinkSpriteSheet, spriteBatch);
            Link       = new Link(this, SpriteLink, LinkSpawn);
            hud        = new HUD(this);
            inv        = new Inventory(this);
            sel        = new SelectionMenu(this);
            this.song  = Content.Load <Song>("musicForGame");
            MediaPlayer.Play(song);
            MediaPlayer.Volume             = 0f;
            MediaPlayer.IsMuted            = true;
            MediaPlayer.IsRepeating        = true;
            MediaPlayer.MediaStateChanged += MediaPlayer_MediaStateChanged;

            CurrDungeon = new Dungeon(this, DefaultDungeon);
        }