Skip to content

Conversation

olivegamestudio
Copy link

@olivegamestudio olivegamestudio commented Aug 18, 2025

This is a tutorial of taking the Dungeon Slime windows game to support Apple and Android devices.

@Copilot Copilot AI review requested due to automatic review settings August 18, 2025 16:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds mobile deployment capabilities to the MonoGame Dungeon Slime project by implementing a cross-platform architecture with Android support. It demonstrates converting a single-platform Windows project to support multiple platforms including Windows desktop and Android mobile.

  • Restructures project to separate platform-specific shells from shared game logic
  • Adds Android project with proper configuration for mobile deployment
  • Implements shared common library for cross-platform code reuse

Reviewed Changes

Copilot reviewed 222 out of 496 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Directory.Packages.props Centralizes NuGet package version management across all projects
DungeonSlime.Android/* Complete Android project implementation with MonoGame mobile configuration
DungeonSlime.Common/* Shared game logic library targeting multiple platforms
DungeonSlime/* Windows desktop project shell
MonoGameLibrary/* Cross-platform game engine utilities

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SimonDarksideJ SimonDarksideJ changed the base branch from 3.8.4 to 3.8.5 September 2, 2025 12:43
@SimonDarksideJ
Copy link
Contributor

*Note

Just updated the base to the correct target and noted a lot of confusing merge conflicts, suggest pulling from the new base and resolving

olivegamestudio and others added 8 commits September 2, 2025 17:15
* Add solution from previous tutorial but updated Gum library.

* Add project from part 1.

* Add blank ios project.

* Add android blank project.

* All projects included in solution. Blank projects.

* Add common empty project.

* Add reference to common project.

* Move code from desktop project to common project.

* Add content files and updated project.

* Add specific library versions.

* Running in iOS simulator.

* Set orientation to landscape.

* Fix XML documentation in TextureRegion, GamePadInfo, InputManager

Corrected parameter documentation syntax in TextureRegion.cs and GamePadInfo.cs. Removed unnecessary parameter description for `game` in InputManager.cs constructor.

* Add solution for stores.

* Copy 04 source to 05 to start next part.

* Update application identifiers and versioning

- Changed Android `ApplicationId` to `com.monogame.dungeonslime`.
- Updated iOS `CFBundleDisplayName` to `DungeonSlime`.
- Modified iOS `CFBundleIdentifier` to `com.monogame.dungeonslime`.
- Added `CFBundleShortVersionString` and `CFBundleVersion` to iOS.
- Adjusted formatting of `UIDeviceFamily` in iOS plist for consistency.

* Set bundle identifier.

* Set deployment target to 12.

* Set deployment target to 15.

* Set to version 15.

* Set version 15.0

* Add assets.

* Add iconset.

* Compressed images.

* Remove OpenAL from references.

* Based off the starterkit project.

* set min version.

* Manually added files.

* actool work

* Milestone - the ipa is uploaded.

* Renamed to Publish example. Add touch solution.

* Updated appicons with monogame ones.

* Add OpenAL support.

* Updated info.plist

* Updated to develop version of monogame.

* Add debugging to catch exceptions.

* Updated with suggestions for device deployment.

* Add items to entitlements.

* Add entitlements for production and development.

* Add conditions for mac development only.

* Add centralized package management and clean up projects

- Introduced `Directory.Packages.props` for centralized version management of MonoGame packages and Gum.MonoGame.
- Removed specific version numbers from package references in `DungeonSlime.Android.csproj`, `DungeonSlime.Common.csproj`, `DungeonSlime.iOS.csproj`, `DungeonSlime.Windows.csproj`, and `MonoGameLibrary.csproj` to allow for the latest versions.
- Updated `RestoreDotnetTools` target in `DungeonSlime.iOS.csproj` for improved formatting.
- Cleaned up `DungeonSlime.sln` and added `DungeonSlime.slnx` to define the solution structure.

* Centralize package version management across projects

Updated `Directory.Packages.props` to manage MonoGame package versions centrally. Restructured `DungeonSlime.sln` and `DungeonSlime.slnx` to include new project entries for `DungeonSlime.iOS` and `DungeonSlime.Android`. Removed specific version numbers from package references in `DungeonSlime.csproj`, `MonoGameLibrary.csproj`, `DungeonSlime.iOS.csproj`, `DungeonSlime.Android.csproj`, `DungeonSlime.Common.csproj`, and `DungeonSlime.Windows.csproj` for improved maintainability and consistency.

* Add openal tests.

* Running in simulator.

* Dont set the presentation parameters outside of Windows.

* Take fix for Gum.

# Conflicts:
#	Tutorials/MobileDeployment/06-Publishing/Directory.Packages.props

* Updated Gum.MonoGame to 2025.8.3.1 - corrected namespaces/usings.

# Conflicts:
#	Tutorials/MobileDeployment/06-Publishing/Directory.Packages.props

* Removes linker issues.

* Folder restructure.

* Removed dungeon slime for a touch demo.

* Running on simulator.

* Animate gesture text.

* Update MonoGame packages and improve gesture handling

- Bump MonoGame packages to version 3.8.5-develop.6.
- Remove version specification in `TouchExample.Android.csproj`.
- Clean up unused `using` directives in `Game1.cs`.
- Clarify supported gestures in `Initialize` method and update `TouchPanel.EnabledGestures`.
- Add `Alpha` property to `Game1` for dynamic text transparency.
- Modify drawing logic in `Draw` method to utilize the new `Alpha` property.
- Update `TouchExample.sln` to include "Solution Items" and reflect Visual Studio 17 compatibility.

* Update MonoGame package versions in Directory.Packages.props

Upgraded `MonoGame.Content.Builder.Task` and `MonoGame.Framework.DesktopGL` to version `3.8.5-develop.6`. Removed `MonoGame.Framework.iOS` and `MonoGame.Framework.Android` packages, indicating they may no longer be needed in the project.

* Update Chapter 1 in README.md for cross-platform setup

Changed the chapter title and added an introduction on converting a Windows-only MonoGame project to support iOS and Android. Included detailed topics covered, project structure, prerequisites, and key features demonstrated for cross-platform development.

* Add Touch Gesture Demo chapter to README.md

This commit introduces Chapter 03 in the README.md, which covers the Touch Gesture Demo. It includes an overview of the chapter's content, project features, prerequisites, supported gestures, and key learning concepts. A new binary image file (image.png) has also been added to the project.

* Refactor solution files for project structure update

Removed project definitions from `TouchExample.sln` to simplify the solution format. Added XML structure in `TouchExample.slnx` to organize projects and solution items, including references to `Directory.Packages.props` and `README.md`, marking both Android and iOS projects for deployment.

* Remove unused binary file image.png

Deleted the binary file `image.png` from the project to clean up unnecessary assets.

* Update MonoGame packages and enhance iOS project files

- Updated MonoGame package versions in `Directory.Packages.props`.
- Expanded `Contents.json` with new image assets for iOS.
- Added multiple binary image files for app icons.
- Modified `DungeonSlime.iOS.csproj` to update target framework, bundle identifier, and codesigning settings; introduced asset compilation target.
- Updated `Entitlements.plist` for development and created `EntitlementsProduction.plist` for production.
- Modified `Info.plist` to update app identifier, display name, and minimum OS version.
- Changed import statements in several C# files to use `Gum.Forms.Controls`.

* Update Gum.MonoGame package and refactor namespaces

- Updated `Gum.MonoGame` package version to `2025.8.3.3`.
- Added `using System;` in `Game1.cs` and updated namespace for `MonoGameGum.Forms.Controls` to `Gum.Forms.Controls`.
- Enhanced logging and error handling in the `Game1` constructor and `Initialize` method.
- Refactored `using` directives in `TitleScene.cs`, `AnimatedButton.cs`, `GameSceneUI.cs`, and `OptionsSlider.cs` to reflect the new namespace structure.

* Add project reference and multi-targeting support

Updated `DungeonSlime.iOS.csproj` to reference `MonoGameLibrary.csproj`.
Modified `MonoGameLibrary.csproj` to support multiple target frameworks, enabling compatibility with both `net8.0` and `net8.0-ios` by conditionally including the appropriate MonoGame packages.

* Update MonoGame packages and enhance game features

- Updated package versions in `Directory.Packages.props`.
- Added new audio files and updated content pipeline in `Content.mgcb`.
- Introduced a grayscale effect shader in `grayscaleEffect.fx`.
- Added new sprite font files for rendering.
- Created a new texture atlas definition and included graphical assets.
- Updated `DungeonSlime.Android.csproj` for new build configurations.
- Refactored `Game1.cs` to inherit from `Core` and improved initialization.
- Introduced `GameController` for handling input actions.
- Added `Bat` class for movement and collision handling.
- Enhanced `Slime` class for improved movement and collision detection.
- Updated `GameScene` to manage game state and UI interactions.
- Created `GameSceneUI` for managing user interface elements.
- Added `OptionsSlider` for audio settings adjustment.
- Updated solution file to include a README and reorganized references.
- Modified `MonoGameLibrary.csproj` to support multiple target frameworks.

* Updated packages.

* Apply matrix from viewportadapter to gum.

* Enhance viewport management and UI scaling

Updated GameScene to integrate new libraries for viewport management and UI handling. Added a BoxingViewportAdapter for scaling, modified InitializeUI for canvas dimensions, and adjusted cursor transformation in Update. Changed background color to black in Draw and ensured sprite batch scaling aligns with the viewport. TitleScene also updated for consistent cursor handling.

* Improve cursor handling and UI button instantiation

Updated `GameScene` to enhance cursor transformation logic with viewport offsets and removed hardcoded canvas dimensions. Refactored `TitleScene` to add a `_startButton` field and adjusted canvas dimensions for a new resolution. Enhanced cursor transformation with detailed comments and debug output. Changed several variable declarations from `var` to explicit types for clarity. Overall improvements to code readability, maintainability, and UI interaction accuracy.

* Add touch support for game controller.

* Use the virtual viewport instead of the actual.

* An alias for `MediaPlayer` from `Microsoft.Xna.Framework.Media`
is also added for easier reference.

* CPM support. Corrected versions. Updated GUM usings.

* Updated README files for samples.

* Changed bundle identifier.
Corrected `<param>` tag formatting in `TextureRegion`,
`Tilemap`, and `GamePadInfo` classes. Removed a redundant
character in the `MouseInfo` class documentation.
Updated the `dpiAware` value from `true/pm` to `true/PM` for consistency and correctness.
@olivegamestudio olivegamestudio force-pushed the feature/mobiledeployment branch from 04fc94c to 224d07b Compare September 2, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants