This repository contains the complete source code and examples for the "Building 2D Games with MonoGame" tutorial series. The series guides you through creating a fully functional 2D game called "Dungeon Slime" while teaching fundamental game development concepts.
The completed game is a snake-like experience with a dungeon theme, featuring:
- Animated sprites with smooth movement.
- Tile-based level design.
- Sound effects and background music.
- Custom UI with menus and gameplay information.
- Visual effects using shaders.
- Complete gameplay loop with scoring and game states.
![]() |
![]() |
|---|---|
| The title screen of Dungeon Slime | Gameplay of Dungeon Slime |
This tutorial series walks you through the complete process of building a 2D game using MonoGame, from setting up your development environment to publishing your finished game. Each chapter builds upon previous knowledge, gradually introducing new concepts and techniques.
The tutorial is designed for:
- Developers with basic C# knowledge looking to get started with game development.
- Programmers interested in learning MonoGame's approach to cross-platform game creation.
- Anyone wanting to understand the fundamentals of 2D game development.
The tutorial series is organized into 27 chapters, each focusing on specific aspects of game development:
- Introduction - Overview of the tutorial series and the game we will build.
- Chapter 01: What is MonoGame - Introduction to MonoGame, its history, and features.
- Chapter 02: Getting Started - Setting up your development environment.
- Chapter 03: The Game1 File - Understanding the foundation of MonoGame projects.
- Chapter 04: Creating a Class Library - Building reusable game components.
- Chapter 05: Content Pipeline - Managing game assets.
- Chapter 06: Working with Textures - Rendering images to the screen.
- Chapter 07: Optimizing Texture Rendering - Using texture atlases for efficiency.
- Chapter 08: The Sprite Class - Creating reusable sprite components.
- Chapter 09: The AnimatedSprite Class - Adding animation to your sprites.
- Chapter 10: Handling Inputs - Working with keyboard, mouse, and gamepad.
- Chapter 11: Input Management - Creating a robust input system.
- Chapter 12: Collision Detection - Detecting interactions between game objects.
- Chapter 13: Working with Tilemaps - Building tile-based game environments.
- Chapter 14: SoundEffects and Music - Adding audio to your game.
- Chapter 15: Audio Controller - Managing game audio effectively.
- Chapter 16: Working with SpriteFonts - Displaying text in your game.
- Chapter 17: Scenes - Managing different game screens and states.
- Chapter 18: Texture Sampling - Creating scrolling backgrounds and visual effects.
- Chapter 19: User Interface Fundamentals - Learning UI design principles.
- Chapter 20: Implementing UI with Gum - Creating functional UI elements.
- Chapter 21: Customizing Gum UI - Styling UI to match your game theme.
- Chapter 22: Snake Game Mechanics - Implementing core snake-like gameplay.
- Chapter 23: Completing the Game - Finalizing game mechanics and states.
- Chapter 24: Shaders - Creating custom visual effects.
- Chapter 25: Packaging Your Game for Distribution - Preparing your game for players.
- Chapter 26: Publishing Your Game to itch.io - Distributing your game online.
- Chapter 27: Conclusion and Next Steps - Continuing your game development journey.
Each chapter's source code is contained in its own folder, allowing you to:
- See the progressive development of the game throughout the tutorial.
- Compare implementations between chapters to understand new concepts.
- Use specific chapters as starting points for your own projects.
To begin using this repository:
- Clone or download the repository.
- Follow the setup instructions in Chapter 02: Getting Started.
- Each chapter folder contains a complete, working project representing that stage of development.
- For the full learning experience, we recommend following the tutorial chapters in sequence.
For additional help and information:

