Skip to content

Commit b2b9687

Browse files
committed
Remove the base.LoadContent call, it's not needed
1 parent 6f3d38e commit b2b9687

File tree

24 files changed

+11
-36
lines changed

24 files changed

+11
-36
lines changed

articles/tutorials/building_2d_games/05_content_pipeline/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Now that we have the MonoGame logo added as an asset in the content project, we
211211
212212
The complete updated `Game1.cs` file should now look like this
213213
214-
[!code-csharp[](./snippets/game1.cs?highlight=10-11,27,45-52)]
214+
[!code-csharp[](./snippets/game1.cs?highlight=10-11,27,44-51)]
215215
216216
Running the game now will show the MonoGame logo displayed in the upper-left corner of the game window.
217217

articles/tutorials/building_2d_games/05_content_pipeline/snippets/game1.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ protected override void Initialize()
2525
protected override void LoadContent()
2626
{
2727
_logo = Content.Load<Texture2D>("images/logo");
28-
base.LoadContent();
2928
}
3029

3130
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/07_optimizing_texture_rendering/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Add this texture atlas to your content project using the MGCB Editor:
172172
173173
First, we will explore creating the texture atlas and defining the texture regions directly in code. Replace the contents of *Game1.cs* with the following:
174174

175-
[!code-csharp[](./snippets/game1/textureatlas_usage.cs?highlight=5,11-15,31-47,67-77)]
175+
[!code-csharp[](./snippets/game1/textureatlas_usage.cs?highlight=5,11-15,31-47,65-75)]
176176

177177
The key changes in this implementation are:
178178

articles/tutorials/building_2d_games/07_optimizing_texture_rendering/snippets/game1/textureatlas_usage.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ protected override void LoadContent()
4545

4646
// retrieve the bat region from the atlas.
4747
_bat = atlas.GetRegion("bat");
48-
49-
base.LoadContent();
5048
}
5149

5250
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/07_optimizing_texture_rendering/snippets/game1/textureatlas_xml_usage.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ protected override void LoadContent()
3636

3737
// retrieve the bat region from the atlas.
3838
_bat = atlas.GetRegion("bat");
39-
40-
base.LoadContent();
4139
}
4240

4341
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/08_the_sprite_class/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ We can simplify this process by adding a sprite creation method to the `TextureA
7272

7373
Now we can adjust our game now to use the `Sprite` class instead of just the texture regions. Replace the contents of *Game1.cs* with the following:
7474

75-
[!code-csharp[](./snippets/game1.cs?highlight=11-15,34-40,63-67)]
75+
[!code-csharp[](./snippets/game1.cs?highlight=11-15,34-40,61-65)]
7676

7777
The key changes in this implementation are:
7878

articles/tutorials/building_2d_games/08_the_sprite_class/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ protected override void LoadContent()
3838
// Create the bat sprite from the atlas.
3939
_bat = atlas.CreateSprite("bat");
4040
_bat.Scale = new Vector2(4.0f, 4.0f);
41-
42-
base.LoadContent();
4341
}
4442

4543
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/09_the_animatedsprite_class/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ We can simplify this process by adding an animated spirte creation method to the
170170

171171
We can now adjust our game now to use the `AnimatedSprite` class to see our sprites come to life. Replaces the contents of *Game1.cs* with the following:
172172

173-
[!code-csharp[](./snippets/game1.cs?highlight=11-15,34-40,50-54)]
173+
[!code-csharp[](./snippets/game1.cs?highlight=11-15,34-40,48-52)]
174174

175175
Here are the key changes in this implementation:
176176

articles/tutorials/building_2d_games/09_the_animatedsprite_class/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ protected override void LoadContent()
3838
// Create the bat animated sprite from the atlas.
3939
_bat = atlas.CreateAnimatedSprite("bat-animation");
4040
_bat.Scale = new Vector2(4.0f, 4.0f);
41-
42-
base.LoadContent();
4341
}
4442

4543
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/10_handling_input/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ For our game, we are going to implement keyboard and gamepad controls based on t
330330

331331
Open *Game1.cs* and update it with the following:
332332

333-
[!code-csharp[](./snippets/game1.cs?highlight=17-21,62-66,71-159,170)]
333+
[!code-csharp[](./snippets/game1.cs?highlight=17-21,60-64,69-157,168)]
334334

335335
The key changes made here are:
336336

articles/tutorials/building_2d_games/10_handling_input/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ protected override void LoadContent()
4444
// Create the bat animated sprite from the atlas.
4545
_bat = atlas.CreateAnimatedSprite("bat-animation");
4646
_bat.Scale = new Vector2(4.0f, 4.0f);
47-
48-
base.LoadContent();
4947
}
5048

5149
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/11_input_management/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ The key changes to the `Core` class are:
372372

373373
Now we can update our `Game1` class to use the new input management system through the `Core` class. Open *Game1.cs* in the game project and update it to the following:
374374

375-
[!code-csharp[](./snippets/game1.cs?highlight=6,76,82,88,94,100,108,113,116,120,126,128-129,134,140,146,152)]
375+
[!code-csharp[](./snippets/game1.cs?highlight=6,74,80,86,92,98,106,111,114,118,124,126-127,132,138,144,150)]
376376

377377
The key changes to the `Game1` class are:
378378

articles/tutorials/building_2d_games/11_input_management/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ protected override void LoadContent()
4545
// Create the bat animated sprite from the atlas.
4646
_bat = atlas.CreateAnimatedSprite("bat-animation");
4747
_bat.Scale = new Vector2(4.0f, 4.0f);
48-
49-
base.LoadContent();
5048
}
5149

5250
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/12_collision_detection/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ If you run the game right now and move the slime around, you will notice a few i
296296

297297
To resolve this, we can update our game to implement these changes using collision detection and response. In the *DungeonSlime* project (your main game project), open the *Game1.cs* file and make the following changes to the `Game1` class:
298298

299-
[!code-csharp[](./snippets/game1.cs?highlight=1,5,25-29,40-45,81-181,186-198,298-299)]
299+
[!code-csharp[](./snippets/game1.cs?highlight=1,5,25-29,40-45,79-179,184-196,296-297)]
300300

301301
The key changes made here are:
302302

articles/tutorials/building_2d_games/12_collision_detection/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ protected override void LoadContent()
5757
// Create the bat animated sprite from the atlas.
5858
_bat = atlas.CreateAnimatedSprite("bat-animation");
5959
_bat.Scale = new Vector2(4.0f, 4.0f);
60-
61-
base.LoadContent();
6260
}
6361

6462
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/13_working_with_tilemaps/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Next, we need to add this configuration file to our content project with the MGC
176176

177177
With all of the assets now in place and configured, we can update the `Game1` class to load the tilemap and draw it. We will also need to update the collision logic so that the boundary is no longer the edge of the screen, but instead the edges of the wall tiles of the tilemap. Open *Game1.cs* and make the following updates:
178178

179-
[!code-csharp[](./snippets/game1.cs?highlight=31-35,46-61,80-82,114,116,118,120,123,125,127,129,147,150,152,155,158,161,163,166,181-183,305-306)]
179+
[!code-csharp[](./snippets/game1.cs?highlight=31-35,46-61,80-82,112,114,116,128,121,123,125,127,145,148,150,153,156,159,161,164,179-181,303-304)]
180180

181181
The key changes to the `Game1` class include:
182182

articles/tutorials/building_2d_games/13_working_with_tilemaps/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ protected override void LoadContent()
8080
// Create the tilemap from the XML configuration file.
8181
_tilemap = Tilemap.FromFile(Content, "images/tilemap-definition.xml");
8282
_tilemap.Scale = new Vector2(4.0f, 4.0f);
83-
84-
base.LoadContent();
8583
}
8684

8785
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/14_soundeffects_and_music/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Add these files to your content project using the MGCB Editor:
172172

173173
Next, open the *Game1.cs* file and update it to the following:
174174

175-
[!code-csharp[](./snippets/game1.cs?highlight=3,6,39-43,92-111,205-206,224-225)]
175+
[!code-csharp[](./snippets/game1.cs?highlight=3,6,39-43,92-111,203-204,222-223)]
176176

177177
The key changes here are:
178178

articles/tutorials/building_2d_games/14_soundeffects_and_music/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ protected override void LoadContent()
109109

110110
// Set the theme music to repeat.
111111
MediaPlayer.IsRepeating = true;
112-
113-
base.LoadContent();
114112
}
115113

116114
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/15_audio_controller/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The key changes made here are:
121121

122122
Next, update the `Game1` class to use the audio controller for audio playback. Open *Game1.cs* and make the following updates:
123123

124-
[!code-csharp[](./snippets/game1.cs?highlight=45-46,77-78,104-105,199-200,218-219,272-290)]
124+
[!code-csharp[](./snippets/game1.cs?highlight=45-46,77-78,104-105,197-198,216-217,270-288)]
125125

126126
The key changes made here are:
127127

articles/tutorials/building_2d_games/15_audio_controller/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ protected override void LoadContent()
103103

104104
// Load the background theme music
105105
_themeSong = Content.Load<Song>("audio/theme");
106-
107-
base.LoadContent();
108106
}
109107

110108
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/16_working_with_spritefonts/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ The key changes here are:
210210

211211
Finally, open the *Game1.cs* file and make the following changes:
212212

213-
[!code-csharp[](./snippets/game1.cs?highlight=48-58,93-99,129-130,246-247,391-402)]
213+
[!code-csharp[](./snippets/game1.cs?highlight=48-58,93-99,129-130,244-245,389-400)]
214214

215215
The key changes made are:
216216

articles/tutorials/building_2d_games/16_working_with_spritefonts/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ protected override void LoadContent()
128128

129129
// Load the font
130130
_font = Content.Load<SpriteFont>("fonts/04B_30");
131-
132-
base.LoadContent();
133131
}
134132

135133
protected override void Update(GameTime gameTime)

articles/tutorials/building_2d_games/17_scenes/snippets/game1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ protected override void Initialize()
2727

2828
protected override void LoadContent()
2929
{
30-
base.LoadContent();
31-
3230
// Load the background theme music
3331
_themeSong = Content.Load<Song>("audio/theme");
3432
}

0 commit comments

Comments
 (0)