/// <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); GameFont = Content.Load <SpriteFont>("GameFont"); Services.AddService <SpriteFont>(GameFont); Services.AddService <SpriteBatch>(spriteBatch); new FadeTextManager(this); IsMouseVisible = true; //MainMenu's Content Load btnLogIn = new LogInButton(Content.Load <Texture2D>(@"OtherAssets\LogIn"), graphics.GraphicsDevice); btnSubmit = new LogInButton(Content.Load <Texture2D>(@"OtherAssets\WelcomeMat"), graphics.GraphicsDevice); //Moves the position of the button btnLogIn.setPosition(new Vector2(GraphicsDevice.Viewport.Width / 2 - GraphicsDevice.Viewport.Width / 6, GraphicsDevice.Viewport.Height / 2)); btnSubmit.setPosition(new Vector2(GraphicsDevice.Viewport.Width / 2 - GraphicsDevice.Viewport.Width / 6, GraphicsDevice.Viewport.Height / 2)); //Textures backgroundTexture = Content.Load <Texture2D>(@"OtherAssets\Background"); menuTexture = Content.Load <Texture2D>(@"OtherAssets\MainMenu"); // TODO: use this.Content to load your game content here //load in background image background = Content.Load <Texture2D>(@"Backgrounds\BackGround"); cherry = new Sprite(Content.Load <Texture2D>(@"Collectables and Exit Image\Cherry"), new Vector2(0, 0), 1); //centre vector centreScreen = new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2); screenWidth = GraphicsDevice.Viewport.Width; screenHeight = GraphicsDevice.Viewport.Height; SetCollectablePositions(); //creating an array to hold a random amount of chasers between 5 and 10 chasers = new ChasingEnemy[Utility.NextRandom(5, 10)]; //creating a chaser depending on the number //generated from the random size of the array for (int i = 0; i < chasers.Length; i++) { chasers[i] = new ChasingEnemy(Content.Load <Texture2D>(@"Collectables and Exit Image/movingCollectable"), new Vector2(Utility.NextRandom(GraphicsDevice.Viewport.Width), Utility.NextRandom(GraphicsDevice.Viewport.Height)), 2); chasers[i].Velocity = (float)Utility.NextRandom(2, 5); chasers[i].CollisionDistance = Utility.NextRandom(3, 5); } MakeWalls(); }