|
|
2 месяцев назад | |
|---|---|---|
| .. | ||
| .config | 2 месяцев назад | |
| .vscode | 2 месяцев назад | |
| Core | 2 месяцев назад | |
| Platforms | 2 месяцев назад | |
| README.md | 2 месяцев назад | |
| RectangleCollisionSample.sln | 2 месяцев назад | |
This is a MonoGame 3.8.* sample project that demonstrates rectangle collision detection. The game features a player character that must avoid falling blocks in a simple 2D environment.
The Rectangle Collision Sample showcases:
The player controls a character that can move left and right using the keyboard. Blocks fall from the top of the screen, and the game detects when the player collides with any block.
✅ Windows - Building and running successfully
✅ DesktopGL - Building and running successfully
✅ Android - Building successfully (requires Android SDK to deploy)
⚠️ iOS - Project created (requires Mac + Xcode to build and test)
RectangleCollisionSample/
│
├── Core/
│ ├── Game1.cs
│ ├── Program.Core.cs
│ ├── RectangleCollisionSample.Core.csproj
│ └── Content/
│ ├── Block.xnb
│ └── Person.xnb
│
├── Platforms/
│ ├── Windows/
│ │ ├── Program.cs
│ │ ├── RectangleCollisionSample.Windows.csproj
│ │ └── app.manifest
│ ├── Desktop/
│ │ ├── Program.cs
│ │ └── RectangleCollisionSample.DesktopGL.csproj
│ ├── Android/
│ │ ├── MainActivity.cs
│ │ ├── RectangleCollisionSample.Android.csproj
│ │ └── AndroidManifest.xml
│ └── iOS/
│ ├── Program.cs
│ ├── RectangleCollisionSample.iOS.csproj
│ └── Info.plist
│
├── .vscode/
│ ├── launch.json
│ └── tasks.json
│
├── RectangleCollisionSample.sln
└── README.md
RectangleCollisionSample.sln in Visual StudioPlatforms/ (Windows, Desktop, Android, iOS) as startup projectbuild-windows, build-desktopgl, or build-android to buildrun-windows or run-desktopgl to run# Build Windows version
dotnet build Platforms/Windows/RectangleCollisionSample.Windows.csproj
# Run Windows version
dotnet run --project Platforms/Windows/RectangleCollisionSample.Windows.csproj
# Build DesktopGL version
dotnet build Platforms/Desktop/RectangleCollisionSample.DesktopGL.csproj
# Run DesktopGL version
dotnet run --project Platforms/Desktop/RectangleCollisionSample.DesktopGL.csproj
# Build Android version
dotnet build Platforms/Android/RectangleCollisionSample.Android.csproj
# Build iOS version (on Mac)
dotnet build Platforms/iOS/RectangleCollisionSample.iOS.csproj
The project uses pre-built XNB content files located in the Content/ folder:
Person.xnb - Player character spriteBlock.xnb - Falling block spriteThese files are automatically copied to the output directory during build.