/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); AudioController.LoadContent(Content); gameMap = Content.Load <Map>("testmap"); enemyManager.LoadContent(Content, GraphicsDevice); itemManager.LoadContent(Content, GraphicsDevice); projectileManager.LoadContent(Content); particleManager.LoadContent(Content); gameHud = new HUD(GraphicsDevice.Viewport); gameHud.LoadContent(Content); parallaxManager = new ParallaxManager(GraphicsDevice.Viewport); parallaxManager.Layers.Add(new ParallaxLayer(Content.Load <Texture2D>("bg/bg0"), new Vector2(0, 0), 0.25f, false, Color.White * 0.75f)); parallaxManager.Layers.Add(new ParallaxLayer(Content.Load <Texture2D>("bg/bg1"), new Vector2(0, 0), 0.15f, false, Color.White * 0.75f)); for (int i = 0; i < NUM_SECTORS; i++) { WalkableLayers.Add(i, gameMap.GetLayer("Walkable" + i) as MapObjectLayer); } gameHero = new Robot(Helper.PtoV((gameMap.GetLayer("Spawn") as MapObjectLayer).Objects[0].Location.Center), true); gameHero.LoadContent(Content, GraphicsDevice); gameCamera = new Camera(GraphicsDevice.Viewport, gameMap); skyTex = Content.Load <Texture2D>("sky"); titleTex = Content.Load <Texture2D>("title"); font = Content.Load <SpriteFont>("font"); ResetGame(); currentSectorColor = sectorColors[0]; showingTitleScreen = true; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); AudioController.LoadContent(Content); gameMap = Content.Load<Map>("testmap"); enemyManager.LoadContent(Content, GraphicsDevice); itemManager.LoadContent(Content, GraphicsDevice); projectileManager.LoadContent(Content); particleManager.LoadContent(Content); gameHud = new HUD(GraphicsDevice.Viewport); gameHud.LoadContent(Content); parallaxManager = new ParallaxManager(GraphicsDevice.Viewport); parallaxManager.Layers.Add(new ParallaxLayer(Content.Load<Texture2D>("bg/bg0"), new Vector2(0, 0), 0.25f, false, Color.White * 0.75f)); parallaxManager.Layers.Add(new ParallaxLayer(Content.Load<Texture2D>("bg/bg1"), new Vector2(0, 0), 0.15f, false, Color.White * 0.75f)); for (int i = 0; i < NUM_SECTORS; i++) { WalkableLayers.Add(i, gameMap.GetLayer("Walkable" + i) as MapObjectLayer); } gameHero = new Robot(Helper.PtoV((gameMap.GetLayer("Spawn") as MapObjectLayer).Objects[0].Location.Center), true); gameHero.LoadContent(Content, GraphicsDevice); gameCamera = new Camera(GraphicsDevice.Viewport, gameMap); skyTex = Content.Load<Texture2D>("sky"); titleTex = Content.Load<Texture2D>("title"); font = Content.Load<SpriteFont>("font"); ResetGame(); currentSectorColor = sectorColors[0]; showingTitleScreen = true; }