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/02_getting_started/index.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
title: "Chapter 02: Getting Started"
3
-
description: Setup your development environment for dotnet development and MonoGame using Visual Studio Code as your IDE.
3
+
description: Setup your development environment for .NET development and MonoGame using Visual Studio Code as your IDE.
4
4
---
5
5
6
-
Unlike game engines, MonoGame is a *framework*. This means it does not come as a standalone program that you download an install with a graphical user interface used to create games. Instead, MonoGame integrates into the standard .NET development workflow, offering a code-first approach to game development. This approach offers several advantages
6
+
Unlike game engines, MonoGame is a *framework*. This means it does not come as a standalone program that you download and install, and does not include a graphical user interface used to create games. Instead, MonoGame integrates into the standard .NET development workflow, offering a code-first approach to game development. This approach offers several advantages:
7
7
8
8
***Flexibility**: Developers are not locked into using a specific editor or interface, allowing them to use their preferred development tools.
9
9
***Integration**: As a .NET library itself, MonoGame can easily integrate with other .NET libraries and tools.
@@ -29,7 +29,7 @@ The first thing we need to do is install the .NET *Software Development Kit* (SD
29
29
3. Once the download finishes, run the installer.
30
30
31
31
> [!NOTE]
32
-
> For the time being, MonoGame requires that you install the **Intel** version even if you are using an Apple Silicon (M1/M2) Mac. For Apple Silicon Macs, it also requires that [Rosetta](https://support.apple.com/en-us/HT211861)is enabled.
32
+
> For the time being, MonoGame requires that you install the **Intel** version even if you are using an Apple Silicon (M1/M2) Mac. For Apple Silicon Macs, it also requires that [Rosetta](https://support.apple.com/en-us/HT211861)be enabled.
33
33
34
34
### [Linux](#tab/linux)
35
35
1. Open a new *Terminal* window
@@ -60,7 +60,7 @@ dotnet new install MonoGame.Templates.CSharp
60
60
61
61
## Installing Visual Studio Code
62
62
63
-
*Visual Studio Code* (VSCode) is a free, light weight editor. Depending on the programming language you are using, it's just a matter of installing the correct extension to support that language. VSCode is also cross-platform, meaning you can use it for development on Windows, macOS, and Linux. To ensure that all readers can follow this tutorial regardless of operating system, we'll be using VSCode as our IDE.
63
+
*Visual Studio Code* (VSCode) is a free, light weight editor. Depending on the programming language you are using, it is just a matter of installing the appropriate extension to support that particular language. VSCode is also cross-platform, meaning you can use it for development on Windows, macOS, and Linux. To ensure that all readers can follow this tutorial regardless of the operating system used, we will be using VSCode as our IDE.
64
64
65
65
To install VSCode, follow the instructions for your operating system below:
66
66
@@ -87,11 +87,11 @@ To install VSCode, follow the instructions for your operating system below:
87
87
88
88
## Install the C# Dev Kit Extension
89
89
90
-
For C# development using VSCode, it's recommended to use the official *C# Dev Kit* extension provided by Microsoft. Installing this extension will add additional features to VSCode such as a project system and *Solution Explorer* for C# projects. It also provides code editing features such as syntax highlighting, code completion, code navigation, refactoring, NuGet package management, and debugging tools.
90
+
For C# development using VSCode, it is recommended to use the official *C# Dev Kit* extension provided by Microsoft. Installing this extension will add additional features to VSCode such as a project system and *Solution Explorer* for C# projects. It also provides code editing features such as syntax highlighting, code completion, code navigation, refactoring, NuGet package management, and debugging tools.
91
91
92
92
To install the C# Dev Kit extension, perform the following:
93
93
94
-
1. Launch the Visual Studio Code application.
94
+
1. Launch the *Visual Studio Code* application.
95
95
2. Open the *Extensions Panel* by clicking the icon in the *Activity Bar* on the left or choosing *View > Extensions* from the top menu.
96
96
3. Enter `C#` in the *Search Box*
97
97
4. Click install for the *C# Dev Kit* extension.
@@ -101,13 +101,13 @@ To install the C# Dev Kit extension, perform the following:
101
101
102
102
## Installing the "MonoGame for VSCode" Extension
103
103
104
-
Throughout this tutorial, we'll be using the MonoGame Content Builder (MGCB) Editor to add content to the game. MonoGame offers an official extension for Visual Studio 2022 that allows you to double-click the *Content.mgcb* file to automatically open it in the MGCB Editor. While there is no official tool for VSCode, there is a an extension developed by community member r88 to provide similar functionality and is regularly used by the MonoGame developers themselves. We'll be using that extension throughout this tutorial.
104
+
Throughout this tutorial, we will be using the MonoGame Content Builder (MGCB) Editor to add content to the game. MonoGame offers an official extension for Visual Studio 2022 that allows you to double-click the *Content.mgcb* file to automatically open it in the MGCB Editor. While there is no official tool for VSCode, there is a an extension developed by community member r88 to provide similar functionality and is regularly used by the MonoGame developers themselves. We will be using that extension throughout this tutorial.
105
105
106
106
To install it, with VSCode open:
107
107
108
108
1. Open the *Extensions Panel* by clicking the icon in the *Activity Bar* on the left or choosing *View > Extensions* from the top menu.
109
-
2. Enter `MonoGame for VSCode`as in the *Search Box*
110
-
3. Click install for the *MonoGame for VSCode* extension by r88.
109
+
2. Enter `MonoGame for VSCode` in the *Search Box*
110
+
3. Click install on the *MonoGame for VSCode* extension by r88.
111
111
112
112
## Setup WINE for Effect Compilation (macOS and Linux Only)
113
113
@@ -120,7 +120,7 @@ To install it, with VSCode open:
120
120
121
121
### [macOS](#tab/macos)
122
122
123
-
Open a new *Terminal* window and enter execute the following commands:
123
+
Open a new *Terminal* window and execute the following commands:
> After performing these steps, a new directory called *.winemonogame* will be created in your home directory. If you ever wish to undo the setup this script performed, you can just simply delete this directory.
132
+
> After performing these steps, a new directory called *.winemonogame* will be created in your home directory. If you ever wish to undo the setup performed by this script, you can simply delete this directory.
> After performing these steps, a new directory called *.winemonogame* will be created in your home directory. If you ever wish to undo the setup this script performed, you can just simply delete this directory.
144
+
> After performing these steps, a new directory called *.winemonogame* will be created in your home directory. If you ever wish to undo the setup performed by this script, you can simply delete this directory.
145
145
146
146
---
147
147
148
148
## Creating Your First MonoGame Application
149
149
150
-
Now that you have your development environment setup, it's time to create your first MonoGame application.
150
+
With your development environment setup, it is time to create your first MonoGame application.
151
151
152
152
1. Launch the VSCode application
153
153
2. Open the *Command Palette* by clicking *View > Command Palette* or by using the keyboard shortcut `CTRL+SHIFT+P`.
154
154
3. Type `.NET New Project` in the *Command Palette* and choose the *.NET New Project* command
155
-
4. Next you'll be shown a list of the available .NET project templates. Enter `MonoGame` into the prompt to filter the project templates to only show the MonoGame ones, then choose the *MonoGame Cross-Platform Desktop Application* project template.
155
+
4. Next, you will be presented with a list of the available .NET project templates. Enter `MonoGame` into the prompt to filter the project templates to only show the MonoGame ones, then choose the *MonoGame Cross-Platform Desktop Application* project template.
156
156
5. After choosing the template, a dialog window will appear asking you to choose a location to save the project.
157
-
6. Next you'll be prompted to enter a name for the project. Enter the name `DungeonSlime`.
157
+
6. Next, you will be prompted to enter a name for the project. Enter the name `DungeonSlime`.
158
158
7. Finally, select the *Create Project* prompt.
159
159
160
-
After selecting *Create Project*, a new C# project will be created based on the MonoGame template we choose and opened automatically in VSCode.
160
+
After selecting *Create Project*, a new C# project will be generated based on the chosen MonoGame template and opened automatically in VSCode.
161
161
162
162
||
163
163
| :---: |
164
164
|**Figure 2-1: A new MonoGame project after being created in Visual Studio Code**|
165
165
166
-
Now that we have the project created, press the `F5` key on your keyboard, or choose *Run > Start Debugging* from the top menu. If prompted for a configuration, choose *C#*. The project will compile and run, displaying a screen similar to the following
166
+
Now that we have the project created, press the `F5` key on your keyboard, or choose *Run > Start Debugging* from the top menu. If prompted for a configuration, choose *C#*. The project will compile and run, displaying a screen similar to the following:
167
167
168
168
||
169
169
| :---: |
@@ -173,29 +173,29 @@ Be amazed, the default MonoGame Cornflower Blue game window. You have just creat
173
173
174
174
1. The application started
175
175
2. The game window was created and graphics were initialized
176
-
3. A loop is entered which performs the following over and over until the game is told to exit:
176
+
3. A loop is entered which performs the following over and over, until the game is told to exit:
177
177
1. The game is updated
178
178
2. The game is rendered to the window
179
179
180
180
You can exit the game at any time by pressing the `Esc` key on your keyboard.
181
181
182
182
> [!NOTE]
183
-
> Above, I mentioned that a loop is entered. This is commonly referred to as the *game loop*, which we'll discuss in more detail in the next chapter. The reason the application enters this loop is because game applications work differently than a traditional desktop application like your web browser.
183
+
> Above, I mentioned that a loop is entered. This is commonly referred to as the *game loop*, which we will discuss in more detail in the next chapter. The reason the application enters this loop is because game applications work differently than traditional desktop applications, such as your web browser.
184
184
>
185
-
> Desktop application are event based, meaning once loaded, the do not do much at all while waiting for input from the user, and then it response to that input event and redraws the window if needed based on the interaction.
185
+
> Desktop applications are event based, meaning once loaded, they do not do much at all while waiting for input from the user. They respond to user interactions and redraw the window only when necessary.
186
186
>
187
-
> In games, things are always happening such as objects moving around like the player or particles. The handle this, games implement a loop structure that runs continuously, first calling a method to update the game logic, and then a draw method to render the current frame, until it has been told to exit.
187
+
> In games, things are always happening, such as objects moving around like the player or particle effects. To handle this, games implement a loop structure that runs continuously, first calling a method to update the game logic, and then a draw method to render the current frame, until it is told to exit.
188
188
189
189
## Conclusion
190
190
191
191
Let's review what you accomplished in this chapter:
192
192
193
193
* You setup your operating system to develop .NET applications by installing the .NET SDK
194
-
* You install the MonoGame project templates.
194
+
* You installed the MonoGame project templates.
195
195
* You installed VSCode and the necessary extension to develop C# applications with VSCode
196
196
* You created and ran your first MonoGame project.
197
197
198
-
Now that your development environment is setup and ready to go, you can dive in and start building your first game. In the next chapter, we'll cover the contents of the *Game1.cs* file that was included in the MonoGame project you just created.
198
+
Now that your development environment is setup and ready to go, you can dive in and start building your first game. In the next chapter, we will cover the contents of the *Game1.cs* file that was included in the MonoGame project you just created.
0 commit comments