Esempio n. 1
0
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;
            l.Theme = Element.None;
            LevelInitTime = TimeSpan.MinValue;

            Viewport v = This.Game.GraphicsDevice.Viewport;

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

            Text title = new Text("titletext", "Fonts/Title", "4Realms");
            title.CenterOn(new Vector2(v.Width / 2, v.Height / 2));
            title.Static = true;
            title.DisplayColor = Color.DodgerBlue;

            context.GetTexture("regen");
            RestorePlayerHealthTrigger t = new RestorePlayerHealthTrigger("trigger", v.Width);
            t.SpawnPoint = new Vector2(v.Width / 2, v.Height / 1.2f);

            if (GamePad.GetState(PlayerIndex.One).IsConnected)
            {
                gamePads.Add(new GamePadController(PlayerIndex.One));
            }
            if (GamePad.GetState(PlayerIndex.Two).IsConnected)
            {
                gamePads.Add(new GamePadController(PlayerIndex.Two));
            }
        }
Esempio n. 2
0
        internal static void Load(Level context)
        {
            FrostbyteLevel l = context as FrostbyteLevel;
            l.Theme = Element.None;

            This.Game.AudioManager.AddBackgroundMusic("Music/CreditsBG");
            This.Game.AudioManager.PlayBackgroundMusic("Music/CreditsBG", 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 / 2.5f;
            scroller.Pos.Y = v.Height / 8;
            scroller.Static = true;

            StreamReader streamReader = new StreamReader("Content/Story/Credits.txt");
            string credits = streamReader.ReadToEnd();
            streamReader.Close();

            scroller.ScrollText(credits);

            if (GamePad.GetState(PlayerIndex.One).IsConnected)
            {
                gamePads.Add(new GamePadController(PlayerIndex.One));
            }
            if (GamePad.GetState(PlayerIndex.Two).IsConnected)
            {
                gamePads.Add(new GamePadController(PlayerIndex.Two));
            }
        }
Esempio n. 3
0
 internal virtual void Load(Level context)
 {
     This.Game.AudioManager.PlayPause();
     This.Game.AudioManager.BackgroundMusicVolume = 1;
     mWorldObjects.Clear();
     mActors.Clear();
     mAnims.Clear();
     LoadBehavior(context);
     PauseSprite = new Sprite("Pause", new Actor(GetAnimation("Pause.anim")));
     PauseSprite.ZOrder = int.MaxValue;
     PauseSprite.Static = true;
     PauseSprite.Visible = false;
     Loaded = true;
 }