Ejemplo n.º 1
0
        public override void LoadContent(ContentManager content)
        {
            using (var data = LevelContent.Read(Identifier))
            {
                data.Resolve(Game.GraphicsDevice);

                foreach (var chunkdata in data.chunks)
                {
                    Chunk chunk = new Chunk(Game, this, chunkdata);
                    chunk.LoadContent(content);
                    Chunks.Add(chunk);
                }

                StartChase  = data.startChase;
                ActiveChunk = Chunks[data.startChunk];
                Next        = data.next;

                Name = data.name;

                TriggeredDialogs = data.storyItems;
            }

            for (int i = 0; i < RandomDialogs.Length - 2; ++i)
            {
                int newIndex = i + (int)Math.Floor(Game.RNG.NextDouble() * (RandomDialogs.Length - i - 1));

                string[] temp = RandomDialogs[i];
                RandomDialogs[i]        = RandomDialogs[newIndex];
                RandomDialogs[newIndex] = temp;
            }

            Player.LoadContent(content);
            Player.Position = ActiveChunk.SpawnPosition;
            ActiveChunk.Activate(Player);
            LastActiveChunk = ActiveChunk;

            //  Force camera to be still
            Camera.Position.X = Player.Position.X;
            Camera.Position.Y = Player.Position.Y;
            Camera.UpdateChunk(ActiveChunk);
            Camera.SnapToLocation();
            Camera.Update();
            Alarm.LoadContent(content);

            Game.MusicEngine.Load("Ambient", "future ambient", 12);
            Game.MusicEngine.Play("Ambient");
            Game.SoundEngine.Load("UI_Button");
            Game.SoundEngine.Load("Player_WalkieEnd");
            Game.SoundEngine.Load("Player_WalkieTalk1");
        }
Ejemplo n.º 2
0
        private void UpdateLoadName(object identifier)
        {
            if (!(RealActiveWindow is LoadScreen))
            {
                return;
            }

            if (identifier == null)
            {
                ((LoadScreen)RealActiveWindow).LevelName = "";
            }
            else
            {
                ((LoadScreen)RealActiveWindow).LevelName = " " + LevelContent.Read(identifier, true).name;
            }
            AdvanceLoad();
        }