//
        // Constructors
        //

        public Scene()
        {
            // Make all the managers
            this.manAnimationFlip   = new AnimationFlipManager(2, 1);
            this.manAnimationFrame  = new AnimationFrameManager(4, 1);
            this.manAnimationMotion = new AnimationMotionManager(1, 1);
            this.manCollisionPair   = new CollisonPairManager(13, 1);
            this.manGameObject      = new GameObjectManager(50, 10);
            this.manSpriteBatch     = new SpriteBatchManager(7, 1);
            this.manSpriteProxy     = new SpriteProxyManager(50, 10);
            this.manSpriteColProxy  = new SpriteCollisonProxyManager(50, 10);
            this.manTimedEvent      = new TimedEventManager(10, 1, SceneManager.Self.AzulClockTime);

            // Make all the other containers
            this.gameData                 = new GameSessionData();
            this.hudDisplay               = this.CreateHud();
            this.collisionBatch           = this.manSpriteBatch.Find(SpriteBatch.Name.SpriteCollisions);
            this.collisionBatch.IsEnabled = false;

            // Set scene data
            this.name                   = Name.UNINITIALIZED;
            this.lastAzulTime           = 0.0f;
            this.alienCoordinatorId     = 0u;
            this.ufoId                  = 0u;
            this.isLoaded               = false;
            this.isPaused               = false;
            this.isMarkedForSceneChange = false;
            this.isMarkedForRemoval     = false;
        }
Esempio n. 2
0
        public override void LoadContent(ContentManager content)
        {
            #region PlayerInstantiation
            //AtlasTest
            Texture2D playerAtlas = content.Load <Texture2D>("Models/ZetaGundam_Atlas_64");
            Texture2D gruntAtlas  = content.Load <Texture2D>("Models/ZakuII_Atlas_64Flipped");

            _player = Factory.CreatePlayer(playerAtlas);

            List <int> wayPointIndexes = new List <int>()
            {
                0, 1
            };
            ISprite gruntMelee = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes);

            ISprite gruntRanged = new GruntRanged(gruntAtlas);

            _font           = content.Load <SpriteFont>("Font");
            _camera         = new PlayerCamera(_graphicsDeviceManager);
            _scoreDisplayer = new HudDisplayer(_camera, _font);

            #endregion

            _sprites = new List <ISprite>
            {
                _player,
                gruntMelee,
                gruntRanged
            };

            _map = new TmxMap("Maps/Tiled/TutorialMap.tmx");
            List <Tileset> tileSets = new List <Tileset>();
            foreach (TmxTileset tileset in _map.Tilesets)
            {
                Texture2D tileSetTexture = content.Load <Texture2D>("maps/Tilesets/" + tileset.Name.ToString());
                tileSets.Add(new Tileset(tileSetTexture, tileset));
            }

            Texture2D background = content.Load <Texture2D>("Backgrounds/LevelBackground1");
            _mapManager = new MapManager(_map, tileSets, background, _sprites);

            Vector2 spawnPoint = _mapManager.GetSpawnPoint(0);
        }
Esempio n. 3
0
        public override void LoadContent(ContentManager content)
        {
            #region PlayerInstantiation
            Texture2D playerAtlas = content.Load <Texture2D>("Models/ZetaGundam_Atlas_64");

            //player = Factory.CreatePlayer(playerAtlas);

            _font           = content.Load <SpriteFont>("Font");
            _camera         = new PlayerCamera(_graphicsDeviceManager);
            _scoreDisplayer = new HudDisplayer(_camera, _font);
            #endregion

            #region EnemyInstantiation
            Texture2D gruntAtlas = content.Load <Texture2D>("Models/ZakuII_Atlas_64Flipped");

            List <int> wayPointIndexes0 = new List <int>()
            {
                0, 1
            };
            ISprite    gruntMelee0      = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes0);
            List <int> wayPointIndexes1 = new List <int>()
            {
                2, 3
            };
            ISprite gruntMelee1 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes1);

            ISprite gruntRanged0 = new GruntRanged(gruntAtlas);

            List <int> wayPointIndexes2 = new List <int>()
            {
                4, 5
            };
            ISprite    gruntMelee2      = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes2);
            List <int> wayPointIndexes3 = new List <int>()
            {
                6, 7
            };
            ISprite gruntMelee3 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes3);

            ISprite gruntRanged1 = new GruntRanged(gruntAtlas);

            List <int> wayPointIndexes4 = new List <int>()
            {
                8, 9
            };
            ISprite    gruntMelee4      = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes4);
            List <int> wayPointIndexes5 = new List <int>()
            {
                10, 11
            };
            ISprite gruntMelee5 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes5);


            #endregion

            #region MapInstantiation
            _sprites = new List <ISprite>
            {
                _player,
                gruntMelee0,
                gruntMelee1,
                gruntRanged0,
                gruntMelee2,
                gruntMelee3,
                gruntRanged1,
                gruntMelee4,
                gruntMelee5,
            };
            _map = new TmxMap("Maps/Tiled/Level1v2.tmx");
            List <Tileset> tileSets = new List <Tileset>();
            foreach (TmxTileset tileset in _map.Tilesets)
            {
                Texture2D tileSetTexture = content.Load <Texture2D>("maps/Tilesets/" + tileset.Name.ToString());
                tileSets.Add(new Tileset(tileSetTexture, tileset));
            }
            Texture2D background = content.Load <Texture2D>("Backgrounds/LevelBackground1");
            _mapManager = new MapManager(_map, tileSets, background, _sprites);
            #endregion
        }