/// <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); // Create title and gameover screens introScreen = new GameScreen(this, Content.Load<Texture2D>("textures/titleScreen"), 10.0f); gameoverScreen = new GameOverGameScreen(this, Content.Load<Texture2D>("textures/gameoverScreen"), 3.0f); // Create main game related stuff world = new World(); world.Load(); // load textures playerTexture = Content.Load<Texture2D>("textures/playerTexture"); backgroundTexture = Content.Load<Texture2D>("Background/Background_1"); backgroundTexture2 = Content.Load<Texture2D>("Background/Background_2"); backgroundTexture3 = Content.Load<Texture2D>("Background/Background_3"); this.black = Content.Load<Texture2D>("black"); this.noise = Content.Load<Texture2D>("noise"); this.parallaxCollection = new ParallaxCollection(this); // create map panel mapPanel = new MapPanel(this, Content.Load<Texture2D>("textures/centerBar"), Content.Load<Texture2D>("textures/darkBar"), Content.Load<Texture2D>("textures/mapIcons")); // create players players = new List<PlayerSprite>(); players.Add(new PlayerSprite(this, 0, new Vector3(3, world.getHeigth(3), 1.0f), playerTexture) { color = new Color(0x48, 0xe6, 0xfe, 255) }); players.Add(new PlayerSprite(this, 1, new Vector3(-3, world.getHeigth(-3), 1.0f), playerTexture) { color = new Color(0xf8, 0xfe, 0x4d, 255) }); // create game screens splitScreens = new RenderTarget2D[2]; splitScreens[0] = new RenderTarget2D(GraphicsDevice, SPLIT_SCREEN_WIDTH, SPLIT_SCREEN_HEIGHT); splitScreens[1] = new RenderTarget2D(GraphicsDevice, SPLIT_SCREEN_WIDTH, SPLIT_SCREEN_HEIGHT); joinedScreen = new RenderTarget2D(GraphicsDevice, SCREEN_WIDTH, SCREEN_HEIGHT); // create cameras cameras = new GameCamera[2]; cameras[0] = new GameCamera(this, splitScreens[0].ToVector(), 0, players[0].worldPosition); cameras[0].FollowPlayer(players[0]); cameras[1] = new GameCamera(this, splitScreens[1].ToVector(), 1, players[1].worldPosition); cameras[1].FollowPlayer(players[1]); joinedCamera = new GameCamera(this, GraphicsDevice.Viewport.ToVector(), 2, new Vector3(0.0f, 0.0f, 1.0f)); // load GUI related stuff spriteFont = Content.Load<SpriteFont>("fonts/Geo"); headlineFont = Content.Load<SpriteFont>("fonts/headline"); scriptFont = Content.Load<SpriteFont>("fonts/script"); menuButtons = Content.Load<Texture2D>("textures/menuButtons"); // create tree collection treeCollection = new TreeCollection(this); treeCollection.Load(); treeCollection.Reset(); // create seed collection seedCollection = new SeedCollection(this); seedCollection.Load(); seedCollection.Reset(); CreateRandomSeeds(NUM_INITIAL_SEEDS, treeCollection.trees[0]); // create fairy collection fairyCollection = new FairyCollection(this); fairyCollection.Load(playerTexture); fairyCollection.Reset(); /* spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, null, null, null, null, GameCamera.CurrentCamera.screenTransform); foreground.Draw(this, gameTime, i); */ // reset "The Void" ResetVoids(1.0f); this.State = GameState.INTRO; }