/// <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); spriteSheet = Content.Load <Texture2D>(@"Textures\SpriteSheet"); titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen"); arialFont = Content.Load <SpriteFont>(@"Fonts\ArialFont"); Camera.WorldRectangle = new Rectangle(0, 0, 1600, 1600); Camera.ViewPortWidth = 800; Camera.ViewPortHeight = 600; TileMap.Initialize(spriteSheet); TileMap.GenerateRandomMap(); Player.Initialize(spriteSheet, new Rectangle(0, 64, 32, 32), 6, new Rectangle(0, 96, 32, 32), 1, new Vector2(32, 32)); EffectsManager.Initialize(spriteSheet, new Rectangle(0, 288, 2, 2), new Rectangle(0, 256, 32, 32), 3); WeaponManager.Texture = spriteSheet; GoalManager.Initialize(spriteSheet, new Rectangle(0, 7 * 32, 32, 32), new Rectangle(3 * 32, 7 * 32, 32, 32), 3, 1); EnemyManager.Initialize(spriteSheet, new Rectangle(0, 160, 32, 32)); }
/// <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); // TODO: use this.Content to load your game content here spriteSheet = Content.Load <Texture2D>(@"Textures\SpriteSheet"); titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen"); pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14"); Player.Initialize(spriteSheet, new Rectangle(0, 64, 32, 32), 6, new Rectangle(0, 96, 32, 32), 1, new Vector2(300, 300)); EffectsManager.Initialize(spriteSheet, new Rectangle(0, 288, 2, 2), new Rectangle(0, 256, 32, 32), 3); TileMap.Initialize(spriteSheet); Camera.WorldRectangle = new Rectangle(0, 0, 1600, 1600); Camera.ViewPortWidth = 800; Camera.ViewPortHeight = 600; }