public CollisionObjectBin(SpriteSpriteCollisionManager collisionManager, int gridCoordX, int gridCoordY)
 {
     this.listOfCollideableObjects = new List<ISpriteCollideable>();
     this.refCollisionManager = collisionManager;
     this.hasMultipleObjects = false;
     this.xCoordInGrid = gridCoordX;
     this.yCoordInGrid = gridCoordY;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create an empty world.
        /// </summary>
        /// <param name="parentScreen">The screen this world will be updated in.</param>
        public World(Screen parentScreen, Player player)
            : base(parentScreen)
        {
            this.worldObjects = new List<WorldObject>();
            this.player = player;
            ParentScreen.Components.Add(player);
            this.interactiveLayers = new Dictionary<int, TileMapLayer>();
            this.parallaxLayers = new Dictionary<int, TileMapLayer>();
            batchService = (ISpriteBatchService)this.Game.Services.GetService(typeof(ISpriteBatchService));
            otherMaps = new List<TileMap>();

            //Set up Sound systems
            audioEngine = new AudioEngine("Content\\System\\Sounds\\Win\\SoundFX.xgs");
            soundBank = new SoundBank(audioEngine, "Content\\System\\Sounds\\Win\\GameSoundBank.xsb");
            waveBank = new WaveBank(audioEngine, "Content\\System\\Sounds\\Win\\GameWavs.xwb");

            // Set up our collision systems:
            spriteCollisionManager = new SpriteSpriteCollisionManager(this.Game, batchService, 40, 40);
            ParentScreen.Components.Add(spriteCollisionManager);

            bgm = this.Game.Content.Load<Song>("System\\Music\\DesertBGM");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(bgm);

            LoadCtorInfos();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Load a world from an XML file.
        /// </summary>
        /// <param name="parentScreen">The screen this world will be updated in.</param>
        /// <param name="fileName">The name of the XML file that contains this World's information.</param>
        public World(Screen parentScreen, string fileName)
            : base(parentScreen)
        {
            this.worldObjects = new List<WorldObject>();
            this.interactiveLayers = new Dictionary<int, TileMapLayer>();
            this.parallaxLayers = new Dictionary<int, TileMapLayer>();
            batchService = (ISpriteBatchService)this.Game.Services.GetService(typeof(ISpriteBatchService));
            otherMaps = new List<TileMap>();

            // Set up our collision systems:
            spriteCollisionManager = new SpriteSpriteCollisionManager(this.Game, batchService, 40, 40);
            ParentScreen.Components.Add(spriteCollisionManager);

            //Set up Sound systems
            audioEngine = new AudioEngine("Content\\System\\Sounds\\SoundFX.xgs");
            soundBank = new SoundBank(audioEngine, "Content\\System\\Sounds\\GameSoundBank.xsb");
            waveBank = new WaveBank(audioEngine, "Content\\System\\Sounds\\GameWavs.xwb");

            bgm = this.Game.Content.Load<Song>("System\\Music\\DesertBGM");
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(bgm);

            // The spritebatch to be used when creating all of our worldObjects:
            spriteBatch = batchService.GetSpriteBatch(Character.SpriteBatchName);
            LoadCtorInfos();

            // Load the contents of the world from the specified XML file:
            LoadWorldXmlFile(fileName);
        }