Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] 2D Onboarding Tutorial #85

Draft
wants to merge 96 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
9df357f
Added preface article
AristurtleDev Nov 5, 2024
28e35bc
Updated toc
AristurtleDev Nov 5, 2024
3c34ca9
Move to tutorials directory
AristurtleDev Nov 6, 2024
92bb76d
revert changes so only new doc is in pr
AristurtleDev Nov 6, 2024
bd96a34
Reword sentence per recommendation
AristurtleDev Nov 6, 2024
7e244e4
Initial Chapter 01
AristurtleDev Nov 6, 2024
3d6a69b
Fix resolution from 48 to 480
AristurtleDev Nov 6, 2024
f942943
Initial add Chapter 02
AristurtleDev Nov 6, 2024
cc005c3
Suggested edits from @lightalkmst
AristurtleDev Nov 6, 2024
d2805df
Initial Chapter 3
AristurtleDev Nov 6, 2024
a30b777
Fix appendix links for future documentation
AristurtleDev Nov 6, 2024
7b4c1e1
Correct spelling of "this" in description
AristurtleDev Nov 6, 2024
4d61645
Initial chapter 04
AristurtleDev Nov 7, 2024
54d979f
Removed "to the players" and "in order" wording as suggested by Enthu…
AristurtleDev Nov 8, 2024
767f156
Change verbiage from "Locate" to "Find" as suggested by EnthusiastGuy
AristurtleDev Nov 8, 2024
4326d40
Added description of what the code added does as suggested by Enthusi…
AristurtleDev Nov 8, 2024
f4e87a4
Added steps for Visual Studio users as suggested by EnthusiastGuy
AristurtleDev Nov 8, 2024
9e8a978
Adjusted wording as suggested by EnthusiastGuy
AristurtleDev Nov 8, 2024
5017f96
Added comments for parameters as suggested by EnthusiastGuy
AristurtleDev Nov 8, 2024
6fd12cb
Moved comparison of file loading vs content pipeline loading higher u…
AristurtleDev Nov 8, 2024
4af01df
Fix spelling of variables
AristurtleDev Nov 8, 2024
7c5a163
Adjust wording based on suggestion from EnthusiastGuy
AristurtleDev Nov 8, 2024
84218f0
Added note referencing existing documentation on benefits of optimizi…
AristurtleDev Nov 8, 2024
8b55d9b
Update wording on draw method responsibility to be more clear as sugg…
AristurtleDev Nov 8, 2024
bdf4a1d
Add source files column for chapters that will have them
AristurtleDev Nov 18, 2024
4782293
Add introduction paragraph
AristurtleDev Nov 18, 2024
f16f296
Expand contractions
AristurtleDev Nov 18, 2024
370716d
Draft commit to create PR
AristurtleDev Nov 18, 2024
d29af49
Merge pull request #1 from AristurtleDev/2d-tutorial-bounty--index
AristurtleDev Nov 18, 2024
7a7da17
Merge branch '2d-tutorial-bounty' into 2d-tutorial-bounty--chapter-01
AristurtleDev Nov 18, 2024
2eac775
Move into tutorials directory
AristurtleDev Nov 18, 2024
a100e91
Make images a 2x2 grid per Simon
AristurtleDev Nov 18, 2024
f62d454
Move tutorials file into tutorials directory and rename to index
AristurtleDev Nov 18, 2024
8af2879
Update chapter table
AristurtleDev Nov 18, 2024
1f80762
Update toc for tutorial
AristurtleDev Nov 18, 2024
b5c0f80
Merge pull request #2 from AristurtleDev/2d-tutorial-bounty--chapter-01
AristurtleDev Nov 18, 2024
224bda3
Merge branch '2d-tutorial-bounty' into 2d-tutorial-bounty--chapter-02
AristurtleDev Nov 18, 2024
2c1f8d4
Move into tutorial directory
AristurtleDev Nov 18, 2024
3f323f3
Fix links
AristurtleDev Nov 18, 2024
08e7131
Add chapter 2 link
AristurtleDev Nov 18, 2024
c883b2e
Update toc for chapter 2
AristurtleDev Nov 18, 2024
312ca66
Merge pull request #3 from AristurtleDev/2d-tutorial-bounty--chapter-02
AristurtleDev Nov 18, 2024
b89a749
Merge branch '2d-tutorial-bounty' into 2d-tutorial-bounty--chapter-03
AristurtleDev Nov 18, 2024
dfe6e55
Move into tutorial directory
AristurtleDev Nov 18, 2024
e6835e3
Update introduction to not repeat "this chapter" statement per Simon
AristurtleDev Nov 18, 2024
7f9e6ae
Restructured document to include sections for each number list item i…
AristurtleDev Nov 18, 2024
55bb2cc
Reword to expand or remove contraction words as necessary
AristurtleDev Nov 18, 2024
df6eba6
Appendixes are not written yet, replaced with default link for now so…
AristurtleDev Nov 18, 2024
0a5d2f7
Added chapter 3 link
AristurtleDev Nov 18, 2024
0099e2b
Include chapter 3 in toc
AristurtleDev Nov 18, 2024
3c5f66a
Merge pull request #4 from AristurtleDev/2d-tutorial-bounty--chapter-03
AristurtleDev Nov 19, 2024
8b12502
Merge branch '2d-tutorial-bounty' into 2d-tutorial-bounty--chapter-04
AristurtleDev Nov 19, 2024
586d71d
Remove duplicate heading
AristurtleDev Nov 19, 2024
510015a
Reword intro
AristurtleDev Nov 19, 2024
d2b8e72
Updated description to match changes being made
AristurtleDev Nov 19, 2024
b8fac3d
Reword intro again
AristurtleDev Nov 20, 2024
a7d494f
Update to focus on content pipeline usage
AristurtleDev Nov 20, 2024
685e215
Move to tutorial directory
AristurtleDev Nov 20, 2024
4ed9400
Minor corrections
AristurtleDev Nov 20, 2024
31e8aa0
Add api links
AristurtleDev Nov 20, 2024
f5d04ee
Add chapter 4 link
AristurtleDev Nov 21, 2024
0b8837f
Correct link to content pipeline documentation
AristurtleDev Nov 21, 2024
ea082ea
Fix xref link for SpriteBatch.Begin
AristurtleDev Nov 21, 2024
c515caa
Added clarification that textures are referred to as sprites per Simon
AristurtleDev Nov 22, 2024
477c6e9
Include chapter 4 in chapters table
AristurtleDev Nov 22, 2024
6c4ee2f
Update toc to include chapter 4
AristurtleDev Nov 22, 2024
33d6694
Make xref links bold as suggested by Simon
AristurtleDev Nov 22, 2024
cccdc22
Move section into an important admonition with clarification on handl…
AristurtleDev Nov 22, 2024
36a88ff
Bold "content pipeline" to make it stand out and put it in title case…
AristurtleDev Nov 22, 2024
9e8fcae
Update verbiage to include "for the target platform" for compiled ass…
AristurtleDev Nov 22, 2024
3d5c577
Correct type of THis to This
AristurtleDev Nov 22, 2024
ed050b9
Expand contraction of We're to We are per suggestion from Simon
AristurtleDev Nov 22, 2024
d87097c
Add bullet point about learning advantages of using content pipeline …
AristurtleDev Nov 22, 2024
d122c45
Merge branch '2d-tutorial-bounty--chapter-04' of https://github.com/A…
AristurtleDev Nov 22, 2024
0ca13f6
Correct summary of chapter 4
AristurtleDev Nov 22, 2024
1ec4645
Correct grammar of "loading" to "load"
AristurtleDev Nov 25, 2024
692dbe6
Added Understanding Content Paths section per recommendation by Simon…
AristurtleDev Nov 25, 2024
6fc93e4
Merge branch 'main' into 2d-tutorial-bounty
SimonDarksideJ Nov 26, 2024
4678054
Merge branch '2d-tutorial-bounty' into 2d-tutorial-bounty--chapter-04
AristurtleDev Nov 27, 2024
81730e8
Remove trailing '
AristurtleDev Nov 27, 2024
8ae134c
Fix issue where xref links in table columns break and wrap in the mid…
AristurtleDev Nov 27, 2024
228b6d8
new draft
AristurtleDev Nov 27, 2024
6abd65f
Move Important admonition block up
AristurtleDev Nov 27, 2024
993a488
Add space after comma
AristurtleDev Nov 27, 2024
4534eee
Add proper xref links
AristurtleDev Nov 27, 2024
10526d4
Make this a subsection of the Drawing A Texture section
AristurtleDev Nov 27, 2024
b54c66e
Merge branch '2d-tutorial-bounty--chapter-04' of https://github.com/A…
AristurtleDev Nov 27, 2024
ce3aaf9
Reword section for better clarity and add focus on MonoGame advantages
AristurtleDev Dec 2, 2024
28fcc93
Expand contractions
AristurtleDev Dec 2, 2024
a545af5
Match description of parameters in tables
AristurtleDev Dec 2, 2024
adbc572
Auto format
AristurtleDev Dec 2, 2024
4960e5e
Sync with upstream main
AristurtleDev Dec 2, 2024
0d039d1
Merge branch '2d-tutorial-bounty' of https://github.com/AristurtleDev…
AristurtleDev Dec 2, 2024
5f368bf
Merge upstream main changes
AristurtleDev Dec 2, 2024
fdda409
Grammar/spelling errors
AristurtleDev Dec 2, 2024
a0158c9
Merge pull request #5 from AristurtleDev/2d-tutorial-bounty--chapter-04
AristurtleDev Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion articles/getting_started/5_adding_basic_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,6 @@ We recommend browsing through the [Getting to know MonoGame](../getting_to_know/

## Further Reading

Check out the [Tutorials section](../tutorials.md) for many more helpful guides and tutorials on building games with MonoGame. We have an expansive library of helpful content, all provided by other MonoGame developers in the community.
Check out the [Tutorials section](../tutorials/index.md) for many more helpful guides and tutorials on building games with MonoGame. We have an expansive library of helpful content, all provided by other MonoGame developers in the community.

Additionally, be sure to check out the official [MonoGame Samples](../samples.md) page for fully built sample projects built with MonoGame and targeting our most common platforms.
2 changes: 1 addition & 1 deletion articles/help_and_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Where to get help and support when using MonoGame.

# Help and Support

There is a wealth of [community created content, blogs and tutorials](tutorials.md) available.
There is a wealth of [community created content, blogs and tutorials](tutorials/index.md) available.

If you want to find an answer to a more specific problem, you can ask it on our [GitHub Discussions](https://github.com/MonoGame/MonoGame/discussions) page.

Expand Down
16 changes: 14 additions & 2 deletions articles/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,20 @@
href: migration/updating_versions.md
- name: Samples and Demos
href: samples.md
- name: Community Tutorials
href: tutorials.md
- name: Tutorials
href: tutorials/
items:
- name: Building 2D Games
href: tutorials/building_2d_games/
items:
- name: "01: What Is MonoGame?"
href: tutorials/building_2d_games/01_what_is_monogame/
- name: "02: Getting Started"
href: tutorials/building_2d_games/02_getting_started/
- name: "03: The Game1 File"
href: tutorials/building_2d_games/03_the_game1_file/
- name: "04: Working with Textures"
href: tutorials/building_2d_games/04_working_with_textures/
- name: Console Access
href: console_access.md
- name: Help and Support
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions articles/tutorials/building_2d_games/01_what_is_monogame/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: "Chapter 01: What is MonoGame"
description: In this chapter, we'll explore the history of MonoGame and what features it provides developers to create games.
---

## A Brief History

In 2006, Microsoft released a game development framework named *XNA Game Studio* to facilitate game development for Windows PC and the Xbox 360 console. It revolutionized game development for indie creators by bringing a simplified approach to building games and offering a set of tools that lowered the entry barrier for aspiring game developers. Out of XNA Game Studio came critically acclaimed titles such as [Bastion](https://www.supergiantgames.com/games/bastion/) and [Terraria](https://terraria.org/). In 2008, XNA was expanded to support development for both the Zune and Windows Phone.

> [!NOTE]
>
> Fun fact, provided by community member stromkos, The release of XNA 3.0 in 2008, which added the support for Windows Phone, is also the release that specified the default window resolution of 800x480 for new projects as this was the preferred resolution on Windows Phone. [It is still the default resolution used in MonoGame projects today](https://github.com/MonoGame/MonoGame/blob/8b35cf50783777507cd6b21828ed0109b3b07b50/MonoGame.Framework/GraphicsDeviceManager.cs#L44).

As XNA become more popular, the need for cross-platform development started to grow. In 2009, [José Antonio Leal de Farias](https://github.com/jalf) introduced *XNA Touch*, an open-source project that aimed to make games with XNA playable on iOS devices. This marked the beginning of what would later become MonoGame. [Dominique Louis](https://github.com/CartBlanche) came on board in 2009 and soon took over as full-time project lead, driving its initial development and expansion. The project attracted other developers such as [Tom Spilman](https://github.com/tomspilman), who were interested in expanding the scope of the project, as well as its reach.

The official first release of MonoGame occurred in 2011, as an open source version of XNA. While it still had the same familiar API as XNA, the cross-platform support was expanded to include Windows, macOS, Linux, iOS, Android, Xbox, and PlayStation. Despite Microsoft discontinuing XNA in 2013, MonoGame continued to grow and develop. Maintenance of the project was given to [Steve Williams](https://github.com/KonajuGames) and [Tom Spilman](https://github.com/tomspilman) in 2014. In order to direct its future development and undertaking, the [MonoGame Foundation](https://monogame.net/about/) was formed on September 29th, 2023.

Today, it is a mature, cross-platform framework, that is built with the spirit of preserving XNA but adopting modern game development practices. Some popular titles created using MonoGame include [Celeste](https://store.steampowered.com/app/504230/Celeste/), [Stardew Valley](https://store.steampowered.com/app/413150/Stardew\_Valley/), and [Streets of Rage 4](https://store.steampowered.com/app/985890/Streets\_of\_Rage\_4/).

<table style="border: transparent;">
<tr>
<td width="50%" align="center">
<figure><img src="./images/celeste.png" alt="Figure 1-1: Celeste."><figcaption><small>Figure 1-1: Celeste</small></figcaption></figure>
</td>
<td width="50%" align="center">
<figure><img src="./images/stardew-valley.png" alt="Figure 1-2: Stardew Valley."><figcaption><small>Figure 1-2: Stardew Valley.</small></figcaption></figure>
</td>
</tr>
<tr>
<td width="50%" align="center">
<figure><img src="./images/sor4.jpg" alt="Figure 1-3: Streets of Rage 4."><figcaption><p><small>Figure 1-3: Streets of Rage 4.</small></p></figcaption></figure>
</td>
<td width="50%">
</td>
</tr>
</table>

## Features

MonoGame, following in the footsteps of XNA, is a "bring your own tools" framework. It provides developers the basic blocks to design the game, engines, and/or tools. As a code-first approach to game development, MonoGame does not include any pre-built editors or interfaces; instead, it gives developers the freedom to create their own working environment.

### API

At its core, MonoGame offers a set of libraries and APIs to handle common game development tasks. These include:

1. **Graphics Rendering**: 2D and 3D rendering are supported through the graphics API offered by MonoGame. This API provides sprite batching for 2D graphics, a flexible 3D pipeline, and shaders for custom visuals and effects.
2. **Input Handling**: Input from keyboard, mouse, gamepads, and touchscreens are supported, allowing for development of games for any platform and different styles of play.
3. **Audio**: A comprehensive audio system that can be used to create sound effects as well as play, music with included support for many audio formats.
4. **Content Pipeline**: An out-of-the-box workflow for importing and processing game assets such as textures, models, and audio, compiling them to a format that is optimal for the game's target platform.
5. **Math Library**: A math library specifically optimized for game development, providing essential mathematical functions and operations.

### Cross Platform

One of the main advantages of MonoGame is its cross-platform support. Games built with MonoGame are compatible with a variety of platforms, including:

* **Desktop**: Windows, macOS, and Linux.
* **Mobile**: iOS and Android.
* **Consoles**: Xbox, PlayStation, and Nintendo Switch [(with appropriate license)](https://docs.monogame.net/articles/console\_access.html).

By providing cross-platform support, developers can target multiple platforms from a single code base, significantly reducing development time and resources needed for porting.

### Programming Language Support

MonoGame is designed and built in C#. It is the official programming language supported in documentation, samples, and community discussion. However, MonoGame is not exclusively tied to C#. As a .NET library, MonoGame can be used with any .NET-compatible language including Visual Basic and F#.

> [!CAUTION]
> While the alternative .NET languages can be used, community support may be limited outside the scope of C#.

Regardless of which .NET language used, developers should have a foundational understanding of the language and programming concepts such as:

* Object-oriented programming.
* Data types and structures.
* Control flow and loops.
* Error handling and debugging.

## See Also

* [About MonoGame | MonoGame](https://monogame.net/about)

## Test Your Knowledge

1. Name one of the advantages of using the MonoGame framework to develop games.

<details>
<summary>Question 1 Answer</summary>

> Any of the following are advantages of using the MonoGame
> 1. It provides cross-platform support, allowing developers to target multiple platforms from a single code base.
>
> 2. It offers a set of libraries and APIs common for game development tasks, such as graphics rendering, input handling, audio, and content management
>
> 3. It is a "bring your own tools" framework, giving developers flexibility in their working environment.

</details><br />


2. What programming languages can be used when creating a game with MonoGame?

<details>
<summary>Question 2 Answer</summary>

> The primary language used is C#, which is the same language that the MonoGame framework is developed in. However, any .NET language can be used, such as F# or Visual Basic.

</details><br />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading