This is a MonoGame sample project that demonstrates particle systems with explosions, smoke plumes, and various particle effects. The project has been modernized to use SDK-style project files and MonoGame 3.8.* NuGet packages.
The ParticleSample demonstrates how to create and manage different types of particle systems in MonoGame:
Key features:
The project contains the following main classes:
ParticleSampleGame.cs - Main game class that manages the particle systemsParticleSystem.cs - Base class for all particle system implementationsParticle.cs - Individual particle data structureExplosionParticleSystem.cs - Explosion particle effectsExplosionSmokeParticleSystem.cs - Smoke effects for explosionsSmokePlumeParticleSystem.cs - Rising smoke plume effectsProgram.cs - Entry point with platform-specific initializationThis project supports the following platforms with MonoGame 3.8.*:
ParticleSample.sln in Visual Studio 2022build-windows - Build Windows versionbuild-desktopgl - Build DesktopGL versionbuild-android - Build Android versiondotnet build ParticleSample.Windows.csproj -c Debug
dotnet run --project ParticleSample.Windows.csproj -c Debug
ParticleSample/
├── Core/ # Shared game logic and particle system code
│ └── ParticleSample.Core.csproj
├── Platforms/
│ ├── Windows/ # Windows-specific entry point and project
│ │ └── ParticleSample.Windows.csproj
│ ├── Desktop/ # DesktopGL (OpenGL) entry point and project
│ │ └── ParticleSample.DesktopGL.csproj
│ ├── Android/ # Android entry point and project
│ │ └── ParticleSample.Android.csproj
│ └── iOS/ # iOS entry point and project
│ └── ParticleSample.iOS.csproj
├── Content/ # Game assets (images, fonts, etc.)
├── .vscode/ # VS Code tasks and launch configs
└── ParticleSample.sln # Solution file referencing all projects
dotnet build ParticleSample.DesktopGL.csproj -c Debug
dotnet run --project ParticleSample.DesktopGL.csproj -c Debug
dotnet build ParticleSample.Android.csproj -c Debug
# Deploy to connected Android device or emulator
dotnet run --project ParticleSample.Android.csproj -c Debug
dotnet build ParticleSample.iOS.csproj -c Debug
# Deploy to connected iOS device or simulator
dotnet run --project ParticleSample.iOS.csproj -c Debug
Use the Debug panel (Ctrl+Shift+D) and select:
This project uses pre-built .xnb content files located in the Content/ directory:
explosion.xnb - Explosion particle texturesmoke.xnb - Smoke particle texturefont.xnb - Font for text renderingThe project does not include a Content.mgcb file as it directly uses the compiled .xnb files.
dotnet restore to restore NuGet packagesThe projects may show warnings about "No Content References Found" - this is expected since we're using pre-built .xnb files directly instead of a Content.mgcb pipeline.
When using VSCode, you can use the following tasks:
Use Ctrl+Shift+P → "Tasks: Run Task" to access these tasks.
This sample is based on Microsoft XNA Community Game Platform samples and is provided for educational purposes.