Exemplo n.º 1
0
        private void BuildLevelContent(JDLevelObject LevelContent)
        {
            // Music
            if (LevelContent.WorldMusic.FilePath != "" && LevelContent.WorldMusic.FileName != "")
            {
                JDBTG.MusicManager.LoadSong(LevelContent.WorldMusic.FileName, LevelContent.WorldMusic.FilePath);
                OverworldSong = LevelContent.WorldMusic.FileName;
            }

            // Ground
            AnyGround ground = new AnyGround(this.Game, LevelContent.GroundAppearance);

            this.LevelContentCollection.Add(ground);

            // Camera
            JDDebugCamera camera = new JDDebugCamera(this.Game, LevelContent.CameraObject);
            this.myGame.CameraReference = camera;

            // Static Objects
            foreach (JDStaticObject entry in LevelContent.StaticObjectSet)
            {
                this.LevelContentCollection.Add(StaticObjectFactory.Spawn(entry, this.Game));
            }

            // Collectable Objects
            foreach (JDCollectableObject entry in LevelContent.CollectableObjectSet)
            {
                this.LevelContentCollection.Add(CollectablesFactory.Spawn(entry, this.Game));
            }

            // Physical Object
            foreach (JDPhysicalObject entry in LevelContent.PhysicalObjectSet)
            {
                this.LevelContentCollection.Add(PhysicalObjectFactory.Spawn(entry, this.Game));
            }

            // CharacterObjects
            foreach (JDCharacterObject entry in LevelContent.CharacterObjectSet)
            {
                this.LevelContentCollection.Add(CharacterFactory.Spawn(entry, this.Game));
            }

            // Trigger Objects
            foreach (JDTriggerObject entry in LevelContent.TriggerObjectSet)
            {
            }
        }
Exemplo n.º 2
0
 public JDLevel(Game game, JDLevelObject LevelContent)
     : base(game)
 {
     BuildLevelContent(LevelContent);
 }