Beispiel #1
0
        public Battle2(EventHandler callback)
            : base(callback)
        {
            if (!contentLoaded)
            {
                pauseFont = Content.Load<SpriteFont>("Battle1BillStatusFont");
                powerUpFont = Content.Load<SpriteFont>("Battle1PowerUpFont");
                alexEnchanterTexture = Content.Load<Texture2D>("alexenchanter");
                isaacTexture = Content.Load<Texture2D>("isaac");
                transparentTexture = Content.Load<Texture2D>("transparent");
                burntPeanutTexture = Content.Load<Texture2D>("peanutgray");
                battle2Music = Content.Load<Song>("battle2music");
                hurtSounds = new SoundEffect[3];
                hurtSounds[0] = Content.Load<SoundEffect>("hurt1");
                hurtSounds[1] = Content.Load<SoundEffect>("hurt2");
                hurtSounds[2] = Content.Load<SoundEffect>("hurt3");
                isaacHurtBadSound = Content.Load<SoundEffect>("isaachurtbad");
                alexLaugh = Content.Load<SoundEffect>("alexlaugh");
                alexEnchanterHitSound = Content.Load<SoundEffect>("OOT_Armos_Hit");
                //alexEnchanterHitSound = Content.Load<SoundEffect>("OOT_ReDead_Hump");
                peanutShieldDeflectSound = Content.Load<SoundEffect>("peanutShieldDeflect");
                potionDrinkSound = Content.Load<SoundEffect>("potiondrink");
                getPowerUpSound = Content.Load<SoundEffect>("getpowerup");
                useHammerSound = Content.Load<SoundEffect>("usehammersound");
                fireballHitSound = Content.Load<SoundEffect>("fireballhit");
                lowHealthBeep = Content.Load<SoundEffect>("lowhealthbeep");
                superFireballRoll = Content.Load<SoundEffect>("fireballrolling");
                peanutShieldBreakSound = Content.Load<SoundEffect>("peanutshieldbreaksound");
                powerUpBarTexture = Content.Load<Texture2D>("poweruptimebar");
                sledgeHammerTexture = Content.Load<Texture2D>("sledgehammer");
                hearts = new Texture2D[5];
                heartEmptyTexture = Content.Load<Texture2D>("heart_empty");
                heartOneQuarterTexture = Content.Load<Texture2D>("heart_onequarter");
                heartHalfTexture = Content.Load<Texture2D>("heart_half");
                heartThreeQuartersTexture = Content.Load<Texture2D>("heart_3quarters");
                heartFullTexture = Content.Load<Texture2D>("heart_Full");
                contentLoaded = true;
            }

            Game1.Game.IsMouseVisible = false;

            isaac = new Character(new Rectangle(Graphics.GraphicsDevice.Viewport.Width / 2 - ISAACWIDTH / 2, Graphics.GraphicsDevice.Viewport.Height - ISAACHEIGHT, ISAACWIDTH, ISAACHEIGHT), new Vector2(GameSettings.IsaacSpeed, GameSettings.IsaacSpeed));
            isaac.Texture = isaacTexture;
            isaac.HP = isaac.MaxHP = ISAAC_MAX_HP;
            isaac.ShootDelay = (int)(250 / GameSettings.IsaacShootSpeed);
            isaac.TimeSinceLastShot = isaac.ShootDelay;

            isaacHurtAnimation = new Animation(1, 50, transparentTexture, isaacTexture);
            lowHealthBeeping = new LoopingSoundEffect(lowHealthBeep, .25f);
            updateHearts();

            alexEnchanter = new AlexEnchanter(new Rectangle(Graphics.GraphicsDevice.Viewport.Width / 2 - ENCHANTERWIDTH / 2, 25, ENCHANTERWIDTH, ENCHANTERHEIGHT));
            alexEnchanter.Texture = alexEnchanterTexture;
            alex = alexEnchanter;
            alexHealthBar = new HealthBar(new Rectangle(0, 0, 200, 10));

            sledgeHammer = new BaseObject(new Rectangle(0, 0, SLEDGEHAMMERWIDTH, SLEDGEHAMMERHEIGHT), 0f);
            sledgeHammerOrigin = new BaseObject(new Rectangle(0, 0, 1, SLEDGEHAMMERHEIGHT), 0f);
            sledgeHammer.Texture = sledgeHammerTexture;

            superFireballRolling = new LoopingSoundEffect(superFireballRoll, .35f);

            soundEffectManager.Play(alexLaugh, .25f);

            MediaPlayer.Play(battle2Music);
            MediaPlayer.Volume = .25f;
            MediaPlayer.IsRepeating = true;
        }
Beispiel #2
0
        public Battle2(EventHandler callback)
            : base(callback)
        {
            if (!contentLoaded)
            {
                pauseFont             = Content.Load <SpriteFont>("Battle1BillStatusFont");
                powerUpFont           = Content.Load <SpriteFont>("Battle1PowerUpFont");
                alexEnchanterTexture  = Content.Load <Texture2D>("alexenchanter");
                isaacTexture          = Content.Load <Texture2D>("isaac");
                transparentTexture    = Content.Load <Texture2D>("transparent");
                burntPeanutTexture    = Content.Load <Texture2D>("peanutgray");
                battle2Music          = Content.Load <Song>("battle2music");
                hurtSounds            = new SoundEffect[3];
                hurtSounds[0]         = Content.Load <SoundEffect>("hurt1");
                hurtSounds[1]         = Content.Load <SoundEffect>("hurt2");
                hurtSounds[2]         = Content.Load <SoundEffect>("hurt3");
                isaacHurtBadSound     = Content.Load <SoundEffect>("isaachurtbad");
                alexLaugh             = Content.Load <SoundEffect>("alexlaugh");
                alexEnchanterHitSound = Content.Load <SoundEffect>("OOT_Armos_Hit");
                //alexEnchanterHitSound = Content.Load<SoundEffect>("OOT_ReDead_Hump");
                peanutShieldDeflectSound = Content.Load <SoundEffect>("peanutShieldDeflect");
                potionDrinkSound         = Content.Load <SoundEffect>("potiondrink");
                getPowerUpSound          = Content.Load <SoundEffect>("getpowerup");
                useHammerSound           = Content.Load <SoundEffect>("usehammersound");
                fireballHitSound         = Content.Load <SoundEffect>("fireballhit");
                lowHealthBeep            = Content.Load <SoundEffect>("lowhealthbeep");
                superFireballRoll        = Content.Load <SoundEffect>("fireballrolling");
                peanutShieldBreakSound   = Content.Load <SoundEffect>("peanutshieldbreaksound");
                powerUpBarTexture        = Content.Load <Texture2D>("poweruptimebar");
                sledgeHammerTexture      = Content.Load <Texture2D>("sledgehammer");
                hearts                    = new Texture2D[5];
                heartEmptyTexture         = Content.Load <Texture2D>("heart_empty");
                heartOneQuarterTexture    = Content.Load <Texture2D>("heart_onequarter");
                heartHalfTexture          = Content.Load <Texture2D>("heart_half");
                heartThreeQuartersTexture = Content.Load <Texture2D>("heart_3quarters");
                heartFullTexture          = Content.Load <Texture2D>("heart_Full");
                contentLoaded             = true;
            }

            Game1.Game.IsMouseVisible = false;

            isaac                   = new Character(new Rectangle(Graphics.GraphicsDevice.Viewport.Width / 2 - ISAACWIDTH / 2, Graphics.GraphicsDevice.Viewport.Height - ISAACHEIGHT, ISAACWIDTH, ISAACHEIGHT), new Vector2(GameSettings.IsaacSpeed, GameSettings.IsaacSpeed));
            isaac.Texture           = isaacTexture;
            isaac.HP                = isaac.MaxHP = ISAAC_MAX_HP;
            isaac.ShootDelay        = (int)(250 / GameSettings.IsaacShootSpeed);
            isaac.TimeSinceLastShot = isaac.ShootDelay;

            isaacHurtAnimation = new Animation(1, 50, transparentTexture, isaacTexture);
            lowHealthBeeping   = new LoopingSoundEffect(lowHealthBeep, .25f);
            updateHearts();

            alexEnchanter         = new AlexEnchanter(new Rectangle(Graphics.GraphicsDevice.Viewport.Width / 2 - ENCHANTERWIDTH / 2, 25, ENCHANTERWIDTH, ENCHANTERHEIGHT));
            alexEnchanter.Texture = alexEnchanterTexture;
            alex          = alexEnchanter;
            alexHealthBar = new HealthBar(new Rectangle(0, 0, 200, 10));

            sledgeHammer         = new BaseObject(new Rectangle(0, 0, SLEDGEHAMMERWIDTH, SLEDGEHAMMERHEIGHT), 0f);
            sledgeHammerOrigin   = new BaseObject(new Rectangle(0, 0, 1, SLEDGEHAMMERHEIGHT), 0f);
            sledgeHammer.Texture = sledgeHammerTexture;

            superFireballRolling = new LoopingSoundEffect(superFireballRoll, .35f);

            soundEffectManager.Play(alexLaugh, .25f);

            MediaPlayer.Play(battle2Music);
            MediaPlayer.Volume      = .25f;
            MediaPlayer.IsRepeating = true;
        }