MonoGame: A .NET framework for making cross-platform games

2026-03-082:1611270github.com

One framework for creating powerful cross-platform games. - MonoGame/MonoGame

MonoGame is a simple and powerful .NET framework for creating games for desktop PCs, video game consoles, and mobile devices using the C# programming language. It has been successfully used to create games such as Streets of Rage 4, Carrion, Celeste, Stardew Valley, and many others.

It is an open-source re-implementation of the discontinued Microsoft's XNA Framework.

We support a growing list of platforms across the desktop, mobile, and console space. If there is a platform we do not support, please make a request or come help us add it.

  • Desktop PCs
    • Windows 10 (22H2+) and up (OpenGL1 & DirectX 102)
    • Linux3 and up (OpenGL1)
    • macOS 13 "Ventura" and up (OpenGL1)
  • Mobile/Tablet Devices
    • Android 6 (API 23) and up (OpenGL)
    • iOS/iPadOS 12.2 and up (OpenGL)
  • Consoles (for registered developers)
    • PlayStation 4
    • PlayStation 5
    • Xbox (GDKX & XDK)
    • Nintendo Switch 1 & 2

Note

Vulkan and DirectX12 graphics support is also being added in preview for 3.8.5 for supported platforms.

Check out the awesome game samples maintained by the MonoGame team:

Platformer 2D Sample NeonShooter
Supported on all platforms Supported on all platforms
Platformer 2D Sample NeonShooter Sample
The Platformer 2D sample is a basic 2D platformer pulled from the original XNA samples and upgraded for MonoGame. Neon Shooter Is a graphically intensive twin-stick shooter with particle effects and save data from Michael Hoffman
Auto Pong Sample Ship Game 3D
Supported on all platforms GL / DX / iOS / Android
Auto Pong Sample ShipGame 3D Sample
A short sample project showing you how to make the classic game of pong, with generated soundfx, in 300 lines of code. 3D Ship Game (Descent clone) sample, pulled from the XNA archives and updated for MonoGame

If you think you have found a bug or have a feature request, use our issue tracker. Before opening a new issue, please search to see if your problem has already been reported. Try to be as detailed as possible in your issue reports.

If you need help using MonoGame or have other questions we suggest you post on GitHub discussions page or Discord server. Please do not use the issue tracker for personal support requests.

If you are interested in contributing fixes or features to MonoGame, please read our contributors guide first.

If you would like to help the project by supporting us financially, consider supporting us via a subscription for the price of a monthly coffee.

Money goes towards hosting, new hardware and if enough people subscribe a dedicated developer.

There are several options on our Donation Page.

Note

For the prerequisites to build from source, please refer to the Requirements file.

The full source code is available here from GitHub:

  • Clone the source: git clone --recurse-submodules https://github.com/MonoGame/MonoGame.git (including resursive submodules).
  • Set up the submodules: git submodule update --init
  • Open the solution for your target platform to build the game framework.
  • Open the Tools solution for your development platform to build the pipeline and content tools.

A high level breakdown of the components of the framework:

The MonoGame project is under the Microsoft Public License except for a few portions of the code. See the LICENSE.txt file for more details. Third-party libraries used by MonoGame are under their own licenses. Please refer to those libraries for details on the license they use.


Page 2

27 lines (18 loc) · 1.47 KB

Auto Pong Sample

This project shows you how to make the classic game of pong, with basic soundfx, in 300 lines of code.

The sample includes:

  • Program Architecture: Using public static classes and fields, regions
  • Basic Physics: Velocity, Position, and Collisions
  • Game State Management: Keeping Score, Resetting the game
  • Basic SoundFX and Music: Playing a Reset Jingle, Paddle + Scoring Soundfx, Dynamic Sound Effect Instances

AutoPong plays itself, so no player input is needed. You can change the code to accept player input, as an exercise.

  • AutoPong doesn't load any content (pngs, wavs, etc...), instead content is created via code.
  • AutoPong is designed using 3 classes: AutoPongGame, AudioSource, and WaveType.
  • The AutoPongGame class is the expected Game class.
  • An AudioSource class is used to make soundfx and music, which utilizes the WaveType for producing different sounds.
  • The simulation and all its controls are built in to the "Update" loop, moving the ball, simulated paddles and win conditions.
  • The draw loop does exactly what you expect and just draws all the game UI including Paddles, the Ball, score and the half-way line (dotted line). All commented for convenience.

If you fancy a challenge, play with the sound generation or even update the paddle controls in the Update loop so you can play yourself (or for the more advanced player, build a proper AI controlled bat)

You can’t perform that action at this time.


Read the original article

Comments

  • By Nition 2026-03-087:504 reply

    If Microsoft hadn't killed XNA (what MonoGame is based on) a decade ago, they could be packaging it with Copilot right now as the ideal code-first AI-assisted game engine. Easy to use, easy to test, no visual editor where AI will struggle like with Unity/Unreal/Godot.

    • By bob1029 2026-03-088:362 reply

      > AI will struggle like with Unity/Unreal/Godot.

      I am automating Unity with headless method invocation of agent authored editor scripts. I don't think "struggle" is the word I'd use to describe how GPT5.4 is currently performing.

      I can tell the agent things like "iterate over all scenes. Wrap lightmap baking in a 5 minute timeout. Identify all scenes that exceed baking time. Inspect the scene objects and identify static geometry with poorly configured light map scale relative to their world space extents."

      • By Nition 2026-03-088:46

        That's fair. I suppose instead of saying "struggle" re the others I should have said "be even more effective" re XNA.

      • By 3371 2026-03-0815:271 reply

        Quite curious about this. Does the agent gets its own repo and deliver with commits?

        • By bob1029 2026-03-0816:04

          No. Not yet, anyways. I maintain autonomy over source control at the moment. Headless activity is verified in a separate unity editor instance before I push any commits. I might look into source control tools once I get through perspective and orthographic screenshot tools. Giving the agent a way to see the final composed scene seems much more valuable than SCM automation right now.

    • By nurettin 2026-03-088:141 reply

      For Lazarus (an IDE with visual components similar to Delphi) I switched to code-first components and did away with the form files. You can probably do this with all of these frameworks.

      • By vintagedave 2026-03-0813:091 reply

        We’re building an AI agent for Delphi — and a major part is it supporting visual form editing. It works. You can see the form change live in the designer as the AI does its stuff.

        It’s not publicly available yet but has an active group of beta testers. https://www.remobjects.com/codebot/delphi.aspx

        • By nurettin 2026-03-0910:10

          Right, good that you've got that going, congratulations to you and your team. Design time does make human development much easier, since you are able to see the working prototype run as you design it, not sure what the point is if AI is doing that, since the value is in making the development cycle shorter, which the AI has no use for.

    • By jayd16 2026-03-087:59

      If they hadn't killed it, it would have a visual editor by now. Or worse, dominated by Maya integrations.

    • By wiseowise 2026-03-088:39

      Microsoft's head died long time ago. Corpo parasite took control of the body completely.

  • By mwkaufma 2026-03-084:182 reply

    For a more actively maintained XNA implementation, also worth looking at Ethan Lee's FNA: https://fna-xna.github.io/

    • By jeswin 2026-03-085:03

      How well does it support Linux + NativeAOT? Thanks in advance.

      Never mind, found this in the docs: https://fna-xna.github.io/docs/appendix/Appendix-A%3A-Native...

    • By azhenley 2026-03-084:372 reply

      I was trying to compare the two. At first glance, MonoGame has far more stars and recent commits. Or is it just in maintenance mode?

      • By rienbdj 2026-03-0810:20

        FNA is for porting /supporting XNA games with minimal changes.

        MonoGame is trying to evolve XNA in small ways.

        For a new project I would pick MonoGame.

      • By PacificSpecific 2026-03-085:022 reply

        I believe FNA is trying to be more loyal to the original XNA while my monogame tends to introduce new features.

        I've been happy with monogame when I used it in the past. I'm pretty sure Celeste was made with FNA

  • By 4pkjai 2026-03-085:001 reply

    I used MonoGame to port my XNA games to other platforms.

    It’s really good, also it was very cool as a junior developer to see the code for the methods I used.

    • By sodafountan 2026-03-086:21

      I did the same. It was cool seeing some of the games I came up with back in the 360 days running on iPhone and Android devices.

HackerNews