This is a cross-platform MonoGame 3.8.4 sample project demonstrating how to aim one object towards another (e.g., a spotlight tracking a cat). The project is organized for modern .NET 8 SDK-style builds and supports Windows, DesktopGL, Android, and iOS.
Aiming/
├── Core/ # Shared game logic (AimingGame.cs, Aiming.Core.csproj)
├── Platforms/
│ ├── Windows/ # Windows-specific entry point and csproj
│ ├── DesktopGL/ # DesktopGL (cross-platform OpenGL) entry point and csproj
│ ├── Android/ # Android entry point, csproj, and manifest
│ └── iOS/ # iOS entry point, csproj, and Info.plist
├── Content/ # Shared content (PNG, XNB, etc.)
├── .vscode/ # VS Code tasks and launch configs
├── README.md # This file
└── Aiming.sln # Visual Studio solution
- .NET 8 SDK
- MonoGame 3.8.4 (NuGet packages are referenced automatically)
- For Android/iOS: Xamarin/MAUI workloads and platform SDKs
- Visual Studio 2022+ or VS Code
- Open
Aiming.sln - Set the desired platform project as startup (Windows, DesktopGL, Android, or iOS)
- Build and run
- Use the provided tasks and launch configurations:
- Build:
build-windows— Windowsbuild-desktopgl— DesktopGLbuild-android— Androidbuild-ios— iOS
- Run/Debug:
Run Windows— Launches Windows buildRun DesktopGL— Launches DesktopGL build
- Build:
- Press
Ctrl+Shift+Bto build, or use the Run/Debug panel
dotnet build Platforms/Windows/Aiming.Windows.csproj
# or
dotnet build Platforms/DesktopGL/Aiming.DesktopGL.csproj
# or
dotnet build Platforms/Android/Aiming.Android.csproj
# or
dotnet build Platforms/iOS/Aiming.iOS.csproj
- Content is loaded as
.xnbor.pngfiles directly, depending on platform. - Android/iOS builds require the appropriate SDKs and emulators/devices.
- If you encounter issues with Android entry points, check the MonoGame 3.8.4 documentation for the latest supported base class for
MainActivity.
MIT (see LICENSE if present)