You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/05_content_pipeline/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ For instance, to load an image file directly at runtime, you would need to:
13
13
14
14
1. Add the image file to your project.
15
15
2. Configure the project to copy the image file on build to the build output folder.
16
-
3. Load the image file as a texture at runtime using the [**Texture2D.FromFile**](xref:Microsoft.Xna.Framework.Graphics.Texture2D.html#Microsoft_Xna_Framework_Graphics_Texture2D_FromFile_Microsoft_Xna_Framework_Graphics_GraphicsDevice_System_String_) method.
16
+
3. Load the image file as a texture at runtime using the [**Texture2D.FromFile**](xref:Microsoft.Xna.Framework.Graphics.Texture2D.FromFile(Microsoft.Xna.Framework.Graphics.GraphicsDevice,System.String)) method.
17
17
18
18
> [!IMPORTANT]
19
19
> A big disadvantage to loading an image file as a texture directly, is when that when it loads it, it does so in its compressed format such as *.png* or *.jpg*. These compression formats are not understood by a Graphics Processing Unit (GPU); they will need to be decompressed into raw bytes as a format the GPU does understand before it can store the data. Doing this can potentially leave a larger memory footprint for your assets. You will also need to handle how different compression formats work on the platform you are targeting such as desktops, mobile, and consoles.
@@ -238,7 +238,7 @@ Running the game now will show the MonoGame logo displayed in the upper-left cor
238
238
239
239
## Adding Build-In Asset Types
240
240
241
-
The MGCB Editor can also create certain built-in asset types. In this section we will explore these types and this functionality. If not already open, [open the MGCB Editor](#opening-the-mgcb-editor) and perform the following:
241
+
The MGCB Editor can also create certain built-in asset types. In this section we will explore these types and this functionality. If not already open, [open the MGCB Editor](#the-mgcb-editor) and perform the following:
242
242
243
243
1. Select the `Content` node.
244
244
2. Right-click it and choose `Add > New Item...` from the context menu.
@@ -283,7 +283,7 @@ In the next chapter, we will explore working with textures in more detail and le
283
283
284
284
1. Directly from file using [**Texture2D.FromFile**](xref:Microsoft.Xna.Framework.Graphics.Texture2D.FromFile(Microsoft.Xna.Framework.Graphics.GraphicsDevice,System.String)). This method requires manually setting up file copying, offers no pre-processing benefits, and can have a higher memory footprint.
285
285
286
-
2. Using the content pipeline with [**Content.Load\<Texture2D>**](xref:Microsoft.Xna.Framework.Content.ContentManager.html#Microsoft_Xna_Framework_Content_ContentManager_Load__1_System_String_). Using the content pipeline optimizes textures into formats for the target platform(s), automatically handles compiling and copying assets during build, and reduces memory footprint, but requires additional setup using the MGCB Editor.
286
+
2. Using the content pipeline with [**Content.Load\<Texture2D>**](xref:Microsoft.Xna.Framework.Content.ContentManager.Load``1(System.String)). Using the content pipeline optimizes textures into formats for the target platform(s), automatically handles compiling and copying assets during build, and reduces memory footprint, but requires additional setup using the MGCB Editor.
287
287
:::
288
288
289
289
2. During the MonoGame content pipeline workflow, assets are compiled and then copied to the project output folder. What is responsible for performing this task?
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/13_working_with_tilemaps/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ The key changes to the `Game1` class include:
199
199
1. The tilemap is loaded from the XML configuration file.
200
200
2. The scale of the tilemap is set to a factor of 4.0.
201
201
5. In [**Update**](xref:Microsoft.Xna.Framework.Game.Update(Microsoft.Xna.Framework.GameTime)), the `screenBounds` variable was removed and the collision logic has been updated to instead use the `_roomBounds` instead.
202
-
6. In [**Draw**](Microsoft.Xna.Framework.Game.Draw(Microsoft.Xna.Framework.GameTime)) the tilemap is drawn.
202
+
6. In [**Draw**](xref:Microsoft.Xna.Framework.Game.Draw(Microsoft.Xna.Framework.GameTime)) the tilemap is drawn.
203
203
204
204
Running the game now with these changes, our game now visually transforms from a simple screen with sprites to a proper game environment with walls and floors. The slime and bat are now confined within the walls of the dungeon defined by our tilemap.
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/17_scenes/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ To get started, in the *MonoGameLibrary* project:
47
47
[!code-csharp[](./snippets/scene.cs#declaration)]
48
48
49
49
> [!NOTE]
50
-
> Just like with the `AudioController` in [Chapter 14](../14_audio_controller/index.md#audiocontroller-idisposable-implementation), each `Scene` implements the `IDisposable` interface. This provides a standardized in method to release the resources held by a scene when it is no longer needed.
50
+
> Just like with the `AudioController` in [Chapter 15](../15_audio_controller/index.md#audiocontroller-idisposable-implementation), each `Scene` implements the `IDisposable` interface. This provides a standardized in method to release the resources held by a scene when it is no longer needed.
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/22_snake_game_mechanics/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "Chapter 22: Snake Game Mechanics"
3
3
description: "Learn how to implement classic snake-like game mechanics and organize game objects into reusable components."
4
4
---
5
5
6
-
In the previous chapters, we have built all the fundamental systems needed for our game: [graphics](../07_optimizing_texture_rendering/index.md), [input](../11_input_management/index.md), [collision detection](../12_collision_detection/index.md), [audio](../15_audio_controller/index.md), [scene management](../17_scenes/index.md), and a [user interface](../19_user_interface/index.html). Now it is time to transform our demo into a complete experience by implementing classic snake-like game mechanics. Before we do that, we first need to define what mechanics make a snake game.
6
+
In the previous chapters, we have built all the fundamental systems needed for our game: [graphics](../07_optimizing_texture_rendering/index.md), [input](../11_input_management/index.md), [collision detection](../12_collision_detection/index.md), [audio](../15_audio_controller/index.md), [scene management](../17_scenes/index.md), and a [user interface](../19_user_interface_fundamentals/index.md). Now it is time to transform our demo into a complete experience by implementing classic snake-like game mechanics. Before we do that, we first need to define what mechanics make a snake game.
7
7
8
8
In this chapter, you will:
9
9
@@ -209,7 +209,7 @@ Next, add the `HandleInput` method to process player input after the `Initialize
209
209
This method implements the following:
210
210
211
211
1. Determine if the player is attempting to change directions instead of directly moving the slime. This direction change will be applied later during the movement cycle update.
212
-
2. Uses [**Vector2.Dot**](xref:xref:Microsoft.Xna.Framework.Vector2.Dot(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) to prevent the slime from reversing into itself, causing an immediate collision and game over state.
212
+
2. Uses [**Vector2.Dot**](xref:Microsoft.Xna.Framework.Vector2.Dot(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) to prevent the slime from reversing into itself, causing an immediate collision and game over state.
213
213
3. Updates the `_nextDirection` value only if the direction input is valid.
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/23_completing_the_game/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -311,7 +311,7 @@ The game at this point is now playable. If you test it out though, you may notic
311
311
312
312
For instance, if a player wants to navigate a tight corner by pressing up and then immediately left, pressing these keys in rapid succession often results in only the second input being registered. When this happens, the slime will only continue left without first moving upward, missing the intended two-part movement completely. This occurs because the second input overwrites the first one before the game has a chance to process it, leading to frustrating gameplay.
313
313
314
-
Implementing the input buffering technique we introduced in [Chapter 10](../10_handling_input/index.md#input-buffering) aims to solve this problem in our `Slime` class.
314
+
Implementing the input buffering technique we introduced in [Chapter 10](../10_handling_input/index.md#implementing-a-simple-input-buffer) aims to solve this problem in our `Slime` class.
315
315
316
316
### Implementing Input Buffering in the Slime Class
Copy file name to clipboardExpand all lines: articles/tutorials/building_2d_games/26_publish_to_itch/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,18 +135,18 @@ Following the basic information about the project, the next section of the form
135
135
136
136
### Uploads
137
137
138
-
After choosing the pricing options for the project, the next part of the form is for uploading files that users can download for the project. This is where you will add the platform-specific builds you created using the steps in [Chapter 25](../25_packaging_the_game/index.md). Itch.io supports multiple file uploads, allowing you to provide the appropriate version for each platform you support.
138
+
After choosing the pricing options for the project, the next part of the form is for uploading files that users can download for the project. This is where you will add the platform-specific builds you created using the steps in [Chapter 25](../25_packaging_game/index.md). Itch.io supports multiple file uploads, allowing you to provide the appropriate version for each platform you support.
139
139
140
140
> [!NOTE]
141
-
> Before uploading, ensure the builds are properly packaged into either ZIP (Windows) or tar.gz (macOS/Linux) archives as discussed in [Chapter 25](../25_packaging_the_game/index.md).
141
+
> Before uploading, ensure the builds are properly packaged into either ZIP (Windows) or tar.gz (macOS/Linux) archives as discussed in [Chapter 25](../25_packaging_game/index.md).
142
142
143
143
To upload a file for the project:
144
144
145
145
1. Click the "Upload files" button.
146
146
2. In the file select dialog, navigate to and select the file you want to upload.
147
147
148
148
> [!NOTE]
149
-
> For a MonoGame game project, you would upload the archived builds that you created through the steps in [Chapter 25](../25_packaging_the_game/index.md).
149
+
> For a MonoGame game project, you would upload the archived builds that you created through the steps in [Chapter 25](../25_packaging_game/index.md).
150
150
151
151
Once the upload has completed, you will be presented with options to set the following:
0 commit comments