コード例 #1
0
ファイル: Intro.cs プロジェクト: nemec/4Realms
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;

            l.Theme = Element.None;

            l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator();
            l.DiaryEntries.MoveNext();

            This.Game.AudioManager.AddBackgroundMusic("Music/TitleScreenBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/TitleScreenBG", 0.1f);

            Viewport v = This.Game.GraphicsDevice.Viewport;

            scroller        = new TextScroller("intro_text", v.Width * 3 / 4, v.Height * 3 / 4);
            scroller.Pos.X  = v.Width / 8;
            scroller.Pos.Y  = v.Height / 8;
            scroller.Static = true;
            scroller.ScrollText(l.DiaryEntries.Current);


            if (GamePad.GetState(PlayerIndex.One).IsConnected)
            {
                gamePads.Add(new GamePadController(PlayerIndex.One));
            }
            if (GamePad.GetState(PlayerIndex.Two).IsConnected)
            {
                gamePads.Add(new GamePadController(PlayerIndex.Two));
            }
        }
コード例 #2
0
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;

            l.Theme = Element.Earth;
            XDocument doc = XDocument.Load(@"Content/EarthLevel.xml");

            l.Load(doc);

            l.HUD.LoadCommon(new GenericTheme());

            l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator();

            l.ExitPortalSpawnPoint = new Vector2(7776, 2700);

            Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White);
            mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(108 * Tile.TileSize, 119 * Tile.TileSize);
            //mage.SpawnPoint = new Vector2(7776, 2684);  // Boss spot
            mage.Speed = 1;
            mage.Scale = 0.7f;
            l.HUD.AddPlayer(mage);

            Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White);
            mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(108 * Tile.TileSize, 121 * Tile.TileSize);
            //mage2.SpawnPoint = new Vector2(7756, 2684);  // Boss spot
            mage2.Speed = 1;
            mage2.Scale = 0.7f;
            l.HUD.AddPlayer(mage2);

            This.Game.AudioManager.AddBackgroundMusic("Music/EarthBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/EarthBG", 0.1f);

            l.isPauseEnabled = true;

            l.HUD.FadeText("Chapter I: Solum's Forest");

            #region loadeffects etc
            l.GetEffect("ParticleSystem");
            #endregion loadeffects etc

            #region load textures
            l.GetTexture("Blank");
            l.GetTexture("blood");
            l.GetTexture("boulder");
            l.GetTexture("dirtParticle");
            l.GetTexture("Earth");
            l.GetTexture("Earthquake Rock");
            l.GetTexture("earthquake");
            l.GetTexture("evil");
            l.GetTexture("fire darker");
            l.GetTexture("fire");
            l.GetTexture("fireParticle");
            l.GetTexture("ice");
            l.GetTexture("lava");
            l.GetTexture("Lightning");
            l.GetTexture("maroon fire");
            l.GetTexture("Normal");
            l.GetTexture("poison");
            l.GetTexture("red fire");
            l.GetTexture("regen");
            l.GetTexture("smoke");
            l.GetTexture("snowflake");
            l.GetTexture("sparkball");
            l.GetTexture("water stream");
            l.GetTexture("water");
            l.GetTexture("waterParticle");
            l.GetTexture("WaterTexture");
            #endregion load textures

            Collision.Lists.Add(new KeyValuePair <int, int>(1, 2));
            Collision.Lists.Add(new KeyValuePair <int, int>(1, 3));
            Collision.Lists.Add(new KeyValuePair <int, int>(2, 3));
        }
コード例 #3
0
ファイル: Water.cs プロジェクト: nemec/4Realms
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;

            l.Theme = Element.Water;
            XDocument doc = XDocument.Load(@"Content/WaterLevel.xml");

            l.Load(doc);

            l.HUD.LoadCommon(new WaterTheme());

            l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator();

            l.ExitPortalSpawnPoint = new Vector2(10123, 3771);

            Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White);
            mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(6 * Tile.TileSize, 52 * Tile.TileSize);
            // mage.SpawnPoint = new Vector2(10143, 3771);
            // mage.SpawnPoint = new Vector2(147*64+32, 67*64+32);
            mage.Speed = 1;
            mage.Scale = 0.7f;
            l.HUD.AddPlayer(mage);

            Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White);
            mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(6 * Tile.TileSize, 53 * Tile.TileSize);
            //mage2.SpawnPoint = new Vector2(147*64+32, 68*64+32);
            mage2.Speed = 1;
            mage2.Scale = 0.7f;
            l.HUD.AddPlayer(mage2);

            This.Game.AudioManager.AddBackgroundMusic("Music/WaterBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/WaterBG", 0.3f);

            l.isPauseEnabled = true;

            l.HUD.FadeText("Chapter III: Mercutio's Temple of Ice");

            #region loadeffects etc
            l.GetEffect("ParticleSystem");
            #endregion loadeffects etc

            #region load textures
            l.GetTexture("Blank");
            l.GetTexture("blood");
            l.GetTexture("boulder");
            l.GetTexture("dirtParticle");
            l.GetTexture("Earth");
            l.GetTexture("Earthquake Rock");
            l.GetTexture("earthquake");
            l.GetTexture("evil");
            l.GetTexture("fire darker");
            l.GetTexture("fire");
            l.GetTexture("fireParticle");
            l.GetTexture("ice");
            l.GetTexture("lava");
            l.GetTexture("Lightning");
            l.GetTexture("maroon fire");
            l.GetTexture("Normal");
            l.GetTexture("poison");
            l.GetTexture("red fire");
            l.GetTexture("regen");
            l.GetTexture("smoke");
            l.GetTexture("snowflake");
            l.GetTexture("sparkball");
            l.GetTexture("water stream");
            l.GetTexture("water");
            l.GetTexture("waterParticle");
            l.GetTexture("WaterTexture");
            #endregion load textures

            #region add applicable spells
            Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.LightningOne | Spells.LightningTwo;
            #endregion add applicable spells

            Collision.Lists.Add(new KeyValuePair <int, int>(1, 2));
            Collision.Lists.Add(new KeyValuePair <int, int>(1, 3));
            Collision.Lists.Add(new KeyValuePair <int, int>(2, 3));
        }
コード例 #4
0
ファイル: Fire.cs プロジェクト: nemec/4Realms
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;

            l.Theme = Element.Fire;
            XDocument doc = XDocument.Load(@"Content/FireLevel.xml");

            l.Load(doc);

            l.HUD.LoadCommon(new GenericTheme());

            l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator();

            l.ExitPortalSpawnPoint = new Vector2(7776, 2700);

            Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White);
            mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(59 * Tile.TileSize, 56 * Tile.TileSize);
            //mage.SpawnPoint = new Vector2(8264, 6574);  // Boss spawn
            mage.Speed = 1;
            mage.Scale = 0.7f;
            l.HUD.AddPlayer(mage);

            Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White);
            mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(61 * Tile.TileSize, 56 * Tile.TileSize);
            //mage2.SpawnPoint = new Vector2(8264, 6574);  // Boss spawn
            mage2.Speed = 1;
            mage2.Scale = 0.7f;
            l.HUD.AddPlayer(mage2);

            SimpleDistanceTrigger trigger = new SimpleDistanceTrigger("Boss Room", 32);

            trigger.SpawnPoint       = new Vector2(130 * 64 + 32, 105 * 64);
            trigger.TriggerCondition = delegate()
            {
                if (trigger.SpritesInRange.Count > 0)
                {
                    return(new TriggerMultipleTargetEventArgs(trigger.SpritesInRange));
                }

                return(null);
            };

            trigger.TriggerEffect += delegate(object ob, TriggerEventArgs ta)
            {
                (This.Game.CurrentLevel as FrostbyteLevel).LevelCompleted = true;
                //This.Game.CurrentLevel.Unload();
                //LevelFunctions.LoadNextLevel();
            };

            This.Game.AudioManager.AddBackgroundMusic("Music/FireBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/FireBG", 0.03f);

            l.isPauseEnabled = true;

            l.HUD.FadeText("Chapter IV: Exuro's Volcano");

            #region loadeffects etc
            l.GetEffect("ParticleSystem");
            #endregion loadeffects etc

            #region load textures
            l.GetTexture("Blank");
            l.GetTexture("blood");
            l.GetTexture("boulder");
            l.GetTexture("dirtParticle");
            l.GetTexture("Earth");
            l.GetTexture("Earthquake Rock");
            l.GetTexture("earthquake");
            l.GetTexture("evil");
            l.GetTexture("fire darker");
            l.GetTexture("fire");
            l.GetTexture("fireParticle");
            l.GetTexture("ice");
            l.GetTexture("lava");
            l.GetTexture("Lightning");
            l.GetTexture("maroon fire");
            l.GetTexture("Normal");
            l.GetTexture("poison");
            l.GetTexture("red fire");
            l.GetTexture("regen");
            l.GetTexture("smoke");
            l.GetTexture("snowflake");
            l.GetTexture("sparkball");
            l.GetTexture("water stream");
            l.GetTexture("water");
            l.GetTexture("waterParticle");
            l.GetTexture("WaterTexture");
            #endregion load textures

            #region add applicable spells
            Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.LightningOne | Spells.LightningTwo | Spells.WaterOne | Spells.WaterTwo;
            #endregion add applicable spells

            Collision.Lists.Add(new KeyValuePair <int, int>(1, 2));
            Collision.Lists.Add(new KeyValuePair <int, int>(1, 3));
            Collision.Lists.Add(new KeyValuePair <int, int>(2, 3));
        }
コード例 #5
0
ファイル: Final.cs プロジェクト: nemec/4Realms
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;

            l.Theme = Element.Normal;
            XDocument doc = XDocument.Load(@"Content/FinalLevel.xml");

            l.Load(doc);

            l.HUD.LoadCommon(new GenericTheme());

            l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator();

            l.ExitPortalSpawnPoint = new Vector2(7776, 2700);

            Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White);
            mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(62 * Tile.TileSize, 46 * Tile.TileSize);
            // mage.SpawnPoint = new Vector2(1855, 2640);
            mage.Speed = 1;
            mage.Scale = 0.7f;
            l.HUD.AddPlayer(mage);

            Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White);
            mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(62 * Tile.TileSize, 48 * Tile.TileSize);
            //mage2.SpawnPoint = new Vector2(1875, 2640);
            mage2.Speed = 1;
            mage2.Scale = 0.7f;
            l.HUD.AddPlayer(mage2);

            Enemies.FinalBoss b = new Enemies.FinalBoss("DarkLink", new Vector2(1855, 2340));
            b.mColor = Color.Black;

            This.Game.AudioManager.AddBackgroundMusic("Music/FinalCastleBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/FinalCastleBG", 0.1f);

            l.isPauseEnabled = true;

            l.HUD.FadeText("Final Chapter: Caelestis' Castle");

            #region loadeffects etc
            l.GetEffect("ParticleSystem");
            #endregion loadeffects etc

            #region load textures
            l.GetTexture("Blank");
            l.GetTexture("blood");
            l.GetTexture("boulder");
            l.GetTexture("dirtParticle");
            l.GetTexture("Earth");
            l.GetTexture("Earthquake Rock");
            l.GetTexture("earthquake");
            l.GetTexture("evil");
            l.GetTexture("fire darker");
            l.GetTexture("fire");
            l.GetTexture("fireParticle");
            l.GetTexture("ice");
            l.GetTexture("lava");
            l.GetTexture("Lightning");
            l.GetTexture("maroon fire");
            l.GetTexture("Normal");
            l.GetTexture("poison");
            l.GetTexture("red fire");
            l.GetTexture("regen");
            l.GetTexture("smoke");
            l.GetTexture("snowflake");
            l.GetTexture("sparkball");
            l.GetTexture("water stream");
            l.GetTexture("water");
            l.GetTexture("waterParticle");
            l.GetTexture("WaterTexture");
            #endregion load textures

            #region add applicable spells
            Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.EarthThree | Spells.LightningOne | Spells.LightningTwo | Spells.LightningThree | Spells.WaterOne | Spells.WaterTwo | Spells.WaterThree | Spells.FireOne | Spells.FireTwo | Spells.FireThree;
            #endregion add applicable spells

            Collision.Lists.Add(new KeyValuePair <int, int>(1, 2));
            Collision.Lists.Add(new KeyValuePair <int, int>(1, 3));
            Collision.Lists.Add(new KeyValuePair <int, int>(2, 3));
        }
コード例 #6
0
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;

            l.Theme = Element.Fire;
            XDocument doc = XDocument.Load(@"Content/FireLevel-BossRoom.xml");

            l.Load(doc);

            l.HUD.LoadCommon(new GenericTheme());

            l.DiaryEntries = LevelFunctions.LoadLevelNotes(l.Name).GetEnumerator();

            l.ExitPortalSpawnPoint = new Vector2(7776, 2700);

            Characters.Mage mage = new Characters.Mage("Player 1", PlayerIndex.One, new Color(255, 0, 0), Color.White);
            //mage.SpawnPoint = new Microsoft.Xna.Framework.Vector2(59 * Tile.TileSize, 56 * Tile.TileSize);
            mage.SpawnPoint = new Vector2(130 * 64, 105 * 64);  // Boss spawn
            mage.Speed      = 1;
            mage.Scale      = 0.7f;
            l.HUD.AddPlayer(mage);

            Characters.Mage mage2 = new Characters.Mage("Player 2", PlayerIndex.Two, new Color(114, 255, 255), Color.White);
            //mage2.SpawnPoint = new Microsoft.Xna.Framework.Vector2(61 * Tile.TileSize, 56 * Tile.TileSize);
            mage2.SpawnPoint = new Vector2(130 * 64, (105) * 64);  // Boss spawn
            mage2.Speed      = 1;
            mage2.Scale      = 0.7f;
            l.HUD.AddPlayer(mage2);

            This.Game.AudioManager.AddBackgroundMusic("Music/FireBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/FireBG", 0.03f);

            Obstacles.Obstacle rock = new Obstacles.Rock("rock");
            rock.SpawnPoint += new Vector2(130 * 64 + 32, 106 * 64 + 32);
            rock.Respawn();

            l.isPauseEnabled = true;

            #region loadeffects etc
            l.GetEffect("ParticleSystem");
            #endregion loadeffects etc

            #region load textures
            l.GetTexture("Blank");
            l.GetTexture("blood");
            l.GetTexture("boulder");
            l.GetTexture("dirtParticle");
            l.GetTexture("Earth");
            l.GetTexture("Earthquake Rock");
            l.GetTexture("earthquake");
            l.GetTexture("evil");
            l.GetTexture("fire darker");
            l.GetTexture("fire");
            l.GetTexture("fireParticle");
            l.GetTexture("ice");
            l.GetTexture("lava");
            l.GetTexture("Lightning");
            l.GetTexture("maroon fire");
            l.GetTexture("Normal");
            l.GetTexture("poison");
            l.GetTexture("red fire");
            l.GetTexture("regen");
            l.GetTexture("smoke");
            l.GetTexture("snowflake");
            l.GetTexture("sparkball");
            l.GetTexture("water stream");
            l.GetTexture("water");
            l.GetTexture("waterParticle");
            l.GetTexture("WaterTexture");
            #endregion load textures

            #region add applicable spells
            Characters.Mage.UnlockedSpells = Spells.EarthOne | Spells.EarthTwo | Spells.LightningOne | Spells.LightningTwo | Spells.WaterOne | Spells.WaterTwo;
            #endregion add applicable spells

            Collision.Lists.Add(new KeyValuePair <int, int>(1, 2));
            Collision.Lists.Add(new KeyValuePair <int, int>(1, 3));
            Collision.Lists.Add(new KeyValuePair <int, int>(2, 3));
        }