/// <summary> /// Gets called when a Scene is loaded into memory. /// Load all the stuff needed for Game Scenes /// </summary> protected override void OnSceneLoad() { // Get the green floor SpriteBatch floorBatch = this.ManagerForSpriteBatch.Find(SpriteBatch.Name.Shields); SpriteEntity floorSprite = SpriteEntityManager.Self.Find(Sprite.Name.Floor); floorBatch.Attach(floorSprite, floorSprite.Id); ///// GameObject Factories //////////////////////////// // Create all the shields ShieldFactory shieldFactory = new ShieldFactory(SpriteBatch.Name.Shields); shieldFactory.CreateShields(); // Create all the Walls WallFactory wallFactory = new WallFactory(); wallFactory.CreateWalls(); // Create all the Aliens AlienFactory alienFactory = new AlienFactory(SpriteBatch.Name.Aliens); alienFactory.LoadResources(); alienFactory.CreateAliens(); // Create the player PlayerFactory playerFactory = new PlayerFactory(this); playerFactory.InitializeResources(); playerFactory.CreatePlayer(); // Create the UFO UFOFactory ufoFactory = new UFOFactory(); ufoFactory.CreateObjects(); }