Giter VIP home page Giter VIP logo

monogame.samples's Introduction

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.

Join the chat at https://discord.gg/monogame

Build Status

We use GitHub Actions to automate builds and packages distribution of the latest MonoGame changes. We also rely on a build server to run tests in order to avoid regressions. The table below shows the current build status for the develop branch.

Name Status
Builds Build

Supported Platforms

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

  • Desktop PCs
    • Windows 8.1 and up (OpenGL & DirectX)
    • Windows Store Apps (UWP)
    • Linux (OpenGL)
    • macOS 10.15 and up (OpenGL)
  • Mobile/Tablet Devices
    • Android 6.0 and up (OpenGL)
    • iPhone/iPad 10.0 and up (OpenGL)
  • Consoles (for registered developers)
    • PlayStation 4
    • PlayStation 5
    • Xbox One (both UWP and XDK)
    • Nintendo Switch
    • Google Stadia

Support and Contributions

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 our community forums. Please do not use the GitHub issue tracker for personal support requests.

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

Subscription

If you'd 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.

Source Code

The full source code is available here from GitHub:

  • Clone the source: git clone https://github.com/MonoGame/MonoGame.git
  • 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.

For the prerequisites for building from source, please look at the Requirements file.

A high level breakdown of the components of the framework:

Helpful Links

License

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.

monogame.samples's People

Contributors

asiangoldfish avatar cartblanche avatar danzel avatar dellis1972 avatar jamesc01 avatar nemokradxna avatar simondarksidej avatar tomspilman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monogame.samples's Issues

Make Develop The Default Branch

Should we make the develop branch of this repo the default like we do with MonoGame? I've had one person that was confused why the samples didn't work for them... they were trying to use the master branch samples with the develop branch on GitHub.

Any other way we could clear up this confusion?

@KonajuGames @DDReaper ??

Spacewar sample disappeared?

@tomspilman not sure what's happened by the files for the Spacewar sample have disappeared from the develop branch?

Odd because that PR was merged a while ago, before NeonShooter.

Should I resubmit the PR for that?
Odd thing is that the .SLN files still point to the missing folder?

Platformer2D - MSBuildExtensionsPath not set?!

Hey guys,

I got following error when I try to start the Platformer2D example in MonoDevelop while building:

Error: /path/to/example/MonoGame.Samples/Platformer2D/Platforms/Linux/Platformer2D.csproj: /path/to/example/MonoGame.Samples/Platformer2D/Platforms/Linux/Platformer2D.csproj could not import "$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" (Platformer2D)

I'm not a .NET professional, but in my research the MSBuildExtensionsPath is not set.

echo $(MSBuildExtensionsPath)
MSBuildExtensionsPath: Befehl nicht gefunden.

I use Ubuntu 14.04 and MonoDevelop 5.9.6 and installed monogame with the following guide: http://www.monogame.net/documentation/?page=Setting_Up_MonoGame_Linux

I hope somebody can halp me to solve this problem
Oli

.NET 5.0 compatibility

Currently, the samples simply ain't compatible with .NET 5.0 on regular OpenGL/DirectX Windows build due to .csproj settings, although the very code seems to be .NET 5.0-compliant.

Project type not supported by MonoDevelop

The samples build ok. But they get a slew of run time errors like this one - Cannot copy /home/bruce/Git/MonoGame.Samples/ContentBuilder/bin/Linux/Content/Backgrounds/Layer0_0.xnb to /home/bruce/Git/MonoGame.Samples/Platformer2D/bin/Linux/Debug/Content/Backgrounds/Layer0_0.xnb, as the source file doesn't exist....

So I assume I have to use the Samples-Content project to convert the png's to xnb's. But it doesn't open, there is a popup message:

Could not load project 'Platformer2D/Content/Platformer2D.contentproj' with unknown item type '{96E2B04D-8817-42c6-938A-82C39BA4D311}'

I'm on Linux Mint 16, mono version 3.2.1, monodevelop version 5.1

Loading Song on MS Windows

Hi,

I compiled the samples and erspecially focused on the platformer2d.
i kopied the content files to the corresponding directories, since i recieved exceptions stating, that the content could not be loaded as a non content file.

however i copied the raw assets into the directories as well and the sample works except for the music. xnb files and wav / ogg files are in the same folder, so i cannot explain why this does not work.

my configuration is xamarin studio on windows 10 and i compiled the windows x64 profile

Implement Windows DirectX

We have a Windows desktop OpenGL sample, but we don't have a sample for DirectX on Windows desktop.

Updating MonoGame.Samples for 3.8

Starting a discussion to get a heads of agreement on a plan to update the samples to 3.8

My initial thoughts are as follows:

  • Review and close-out existing PR's for 3.7
  • Review any outstanding issues
  • Commit current examples to a 3.7 branch
  • Update develop branch samples to 3.8
  • Create an updated sample template using 3.8 pattern
  • Review new samples for 3.8

Weigh in below (before we start)

Missing Pericles font causes mysterious build failures

Using the develop build of monogame(since it supports the new pipeline) along with the develop branch of the Samples, I was receiving build failures that only indicated MCGB.exe crashed with only an exit code as feedback.

I opened the Platformer project's *.mcgb file in MonoGame Pipeline and built it from there. There was an error about missing Pericles font. I hunted around the csproj XML, the Platform2d.mcgb, etc. and found no reference to Pericles. Finally I had the notion to open the Hud.spritefont, not knowing anything about the file format and reallizing it was a plaintext file. It had a reference to a font named Pericles.

This font did not exist on my system, and appears to be a Microsoft licensed font that allows redistribution. It is available here:

http://xbox.create.msdn.com/en-US/education/catalog/utility/font_pack

Once I downloaded and installed the fonts, I was able to complete the build with the Pipeline editor, and also build and run the Platformer sample.

Possible solutions:

  1. Reference a font that is more reliable.
  2. Include the *.ttf in the project since it appears to allow redistribution, and include readme advising it must be installed (usually simply double click the file).
  3. If there is some way to reference font families instead of specific fonts, that might be slightly better, and even better also specify fallback font families. I.e. similar to how you would specify commonly installed font-family: Arial, Helvetica, sans-serif in CSS since different OS's will often name their helvetica type font differently due to copyrighted names, but essentially be the same font as far as size/kerning/serifs/etc. are concerned.
  4. Advise upstream monogame to include the font. From what I read online it seems to imply that it was automatically installed with the XNA SDK. So perhaps monogame installer should continue this behavior. This however might lead to confusing issues for amateur developers who use the samples as a starting point, then deploy to other systems where the font doesn't exist, and have to discover the issue in the most difficult way, which is debugging a remote device. The transperancy/automation of this solution will make the developer less aware of the dependency on this font. For this reason this seems like a less desirable solution.

Having written this though and thinking through it more, perhaps some of my objections to 4 are are invalid, since I'm assuming once you perform the content compilation, then the end-user deployments don't need the original font. It is only needed during compilation I am guessing, and the resulting compiled font is what gets included in the output directory and deployed?

Mac Sample build configuration issues

There seem to be some configuration issues getting the samples to work on a Mac.

I'm opening the project in Xamarin Studio 5.5.4, which should be the latest, right now.

The sample project has build configurations set up, but the configuration mappings had each target turned off. http://kortham.net/temp/upshot_JnbZVKkW.png These boxes should all be checked for each of the four configuration options.

I had to manually add the references to the two projects, so they would be included int he Platformer2D build: http://kortham.net/temp/upshot_v2gAJL3m.png

Don't forget to pull your git submodules or you'll have a missing OpenTK file ;) I figured that one out!

The debug configuration mode defines the symbols DEBUG MONOMAC, but the release build configuration doesn't define MONOMAC. It probably should. http://kortham.net/temp/upshot_Jb7ogcEB.png

This issue is a followup to MonoGame/MonoGame#1043

Add 3D Sample

We need to add a sample that exercises the non-SpriteBatch side of rendering. Things to work out:

  • What sample should this be?
  • Can we support PlayStation Mobile?

Improve documentation for building samples on major desktop platforms

The MonoGame ecosystem isn't too large and the IDEs are fairly limited between different platforms. For someone entering game development they're more likely to tackle desktop development first due to the stability of the medium.

Having a walk-through on how to build a sample projects on different desktop platforms would be a big morale booster for new game developers, especially when they're able to see the same sample running on different OSes.

cant update to mg 3.81

before i just had to install net 3.1 ro something.. ive uninstalled all taht..

it wont resolve the xna namespace.. in the netstandard. i can buld one platfrom but i cant share code form desktop to droid

Microsoft.Xna.Framework.Graphics Missing

Just tried booting up the examples. DId a nuget restore. Microsoft.Xna.Framework.Graphics; is missing all over the place. Using MonoGame 3.3 on Windows Visual Studio 2013

Missing README.md for NeonShooter

The README.md file in MonoGame.Samples/NeonShooter/ is missing. All links to the NeonShooter example are directed to this file and there for are broken.

Platformer2D Touch Input

It seems the Platformer2D sample depends on GamePad working on touch devices to control player movement. This breaks down on Windows Phone or Windows 8 tablets where a virtual thumb sticks implementation doesn't exist yet.

Should we add explicit support for touch input? Or should we implement virtual thumb sticks for these platforms?

should update to net 6 libs , for 3.81 since netstandard 2.0 isnt supported for MG game code, people might be confused.

because netstandard 2.0 was supported wiht net6 before, people might expect a straighforward nuget update which isnt gonna work. But if you run the upgrade-assistant too it will analyse if you / can should do it, and on this is will say yea, and might do all the work, as in 100% , possibly, not sure how clean tho.. even updating the MG to the latest net 6 compatible. for everything and the netstandard to net6 libs. , im trying it on my stuff first. wiht vs 2022 .its nearly all orking , and im using a wpf..embedded so i got to ditch 4.8. wpf level editor.. whic can be done with ths assistant its doing amazing things with legacy modules ,i didnt expect it to work all all but its 99.... E_DIT it makes a mess... DONT DO THIS.. rebuild the projects. and the used the guild.. share the Content. mgcb by link to each EXE and put the assets near it... try and configure just by configuration not target or ur will get permuations... jsut do x64, ARM 64, and ANYCPU on the libs.. .. Debug, Release and leave teh defualts._ __my windowing is compex because im not using dhe develop branch windows sizing and postion might work for Gl and DX desktop. Android is fine wht all defaults..

Add Samples To Automated Build

Fix the build server to build the samples develop branch just like we do the main MonoGame project.

The first issue is how to make the existing projects build against a development build of MonoGame? Currently the samples all do this in their csprojs:

<Reference Include="MonoGame.Framework">
  <HintPath>$(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
</Reference>

Which means they assume that MonoGame is installed on the machine.

Should we make part of the samples build process install the latest version of MonoGame? Or should we alter the .csproj to use something more complex like:

<PropertyGroup>
  <MonoGameAssembliesPath Condition=" '$(MonoGameAssembliesPath)' == '' ">$(MSBuildExtensionsPath)\..\MonoGame\v3.0\Assemblies</Configuration>
</PropertyGroup>
<Reference Include="MonoGame.Framework">
   <HintPath>$(MonoGameAssembliesPath)\Windows\MonoGame.Framework.dll</HintPath>
</Reference>

This allows us to overload the location of the MonoGame assemblies from the build server by pre-defining the value of $MonoGameAssembliesPath.

Thoughts?

Improve README.md

Improve the main README.md to include screenshot and descriptions of each sample.

iOS > accelerometer.cs not implemented; default MG implementation laggy

The current implementation of the acceleroment.cs is only working on windows phones. I have used the default way of implementing accelerometer but doing it this way the accelero data becomes very laggy after a minute or so. I switched to th Xamarin implementation of the accelerometer and it was working fine on my iPad. Maybe it would be useful to implement the accelero abstraction for iOS in MG according to http://developer.xamarin.com/recipes/ios/input/accelerometer/use_coremotion_with_accelerometer/

IOS sample multiple issues

Hi folks,

I have just started to try MonoGame for some fun projects and I like it a lot so far.
First thing to do is learning by reading and get a grip on how things are working by reading existing code, so your samples were are nice place to get some compressed and skillful overview ranging over all platforms.
To assure myself that MG is really working an all platforms I decided to test your samples on every platform I can get reach of.
I was lucky with everything except of the OUYA and PSM solution because of a lack of hardware. All windows and android based stuff was working well right out of the box.
Last but not least I tried the IOS solution and have some issues with it.

  1. monogame.png was not copied to output directed > changed the props accordingly
  2. Fonts\Hud could not be loaded > reseted the props without changing them
  3. Font is not rendered correctly, changed the processor to MGSprintFont but this does not help > no solution for this so far...

Here is my dev platform:
MacOs Mavericks with a Window 8.1 Box running in Parallels or native.
I have got a Xamarin IOS and Android License.
Visuals Studio 2013 is compiling the IOS stuff through the Xamarin.IOS build host.
MonoGame was installed with the actual binaries but I have also cloned the git. Samples are cloned via git... just trying to send a commit with my changes ;)

Mac Platformer2D GLError: InvalidFramebufferOperationExt

I ran the 2D platformer sample on my mac and got a GLError on launch:

Unhandled Exception:
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidFramebufferOperationExt
at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError () [0x00024] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Graphics/GraphicsExtensions.cs:806
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformClear (Microsoft.Xna.Framework.Graphics.ClearOptions,Microsoft.Xna.Framework.Vector4,single,int) [0x0010a] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs:314
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear (Microsoft.Xna.Framework.Color) [0x00020] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:404
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyRenderTargets (Microsoft.Xna.Framework.Graphics.RenderTargetBinding[]) [0x000c1] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:709
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize () [0x000a3] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:267
at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter,Microsoft.Xna.Framework.Graphics.GraphicsProfile,Microsoft.Xna.Framework.Graphics.PresentationParameters) [0x00122] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:195
at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize () [0x00089] in /Users/kortham/projects/MonoGame/MonoGame.Framework/GraphicsDeviceManager.cs:372
at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice () [0x00002] in /Users/kortham/projects/MonoGame/MonoGame.Framework/GraphicsDeviceManager.cs:90
at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize () [0x0003a] in /Users/kortham/projects/MonoGame/MonoGame.Framework/GamePlatform.cs:205
at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000d] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Game.cs:678
at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior) [0x0003b] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Game.cs:384
at Microsoft.Xna.Framework.Game.Run () [0x0000d] in /Users/kortham/projects/MonoGame/MonoGame.Framework/Game.cs:370
at Platformer2D.AppDelegate.FinishedLaunching (MonoMac.Foundation.NSObject) [0x00012] in /Users/kortham/projects/MonoGame.Samples/Platformer2D/Program.cs:38
at (wrapper dynamic-method) object.[Platformer2D.AppDelegate.Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject) <IL 0x00011, 0x00062>
at (wrapper native-to-managed) object.[Platformer2D.AppDelegate.Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject) <IL 0x0006c, 0x00183>
at (wrapper managed-to-native) MonoMac.AppKit.NSApplication.NSApplicationMain (int,string[]) <0x00012>
at MonoMac.AppKit.NSApplication.Main (string[]) <IL 0x00041, 0x00103>
at Platformer2D.Program.Main (string[]) [0x00033] in /Users/kortham/projects/MonoGame.Samples/Platformer2D/Program.cs:26

It's right after the GLClear. Sorry I don't have time to delve into this more right now. But if you have any questions, let me know.

The state of the buffermask was:

> bufferMask
MonoMac.OpenGL.ClearBufferMask.ColorBufferBit|MonoMac.OpenGL.ClearBufferMask.DepthBufferBit|MonoMac.OpenGL.ClearBufferMask.StencilBufferBit
    value__: 17664

The list of supported gl extensions that the program printed are here: https://gist.github.com/andykorth/efb40e4e68612361d5da

NeonShooter Sample doesn't build with clean install of MonoGame 3.8.1

In my opinion this sample needs two things.

  1. Provide instructions indicating any dependent runtimes needed to build the shaders.
  2. Get updated to build using Mono 3.8.1

As a beginner using the platform it becomes unwieldy when I can't even build the official samples following the official documentation.

Platformer2D builds on Windows 10 but not on macOS 10.15.1

Solution tried on Windows 10: Samples-WindowsDX.sln
Solution tried on macOS 10.15.1: Samples-OSX.sln

Mono version: 6.4.0.208 (2019-06/07c23f2ca43 Wed Oct 2 04:52:23 EDT 2019)
MonoGame version: 3.7.1
Visual Studio for Mac version: 8.3.10

Upon opening Samples-OSX.sln, Visual Studio reported that it could not find Lidgren.Network.MacOS.csproj or MonoGame.Framework.MacOS.csproj. The Platformer2D project has a warning on it that the MonoMac extension is not installed.

I then removed Lidgren.Network.MacOS and MonoGame.Framework.MacOS from the solution.

I then downloaded the MonoGame 3.7.1 source code, put it in my home directory (/Users/$name), built it with "mono Protobuild.exe," and then copied Lidgren.Network.MacOS.csproj and MonoGame.Framework.Net.MacOS.csproj into the solution.

Building it results in two warnings and one error:
• The two included projects cannot find the assemly System.Drawing.Common.dll
• /Users/$name/MonoGame-3.7.1/MonoGame.Framework/CSC: Error CS0006: Metadata file '/Users/$name/MonoGame-3.7.1/MonoGame.Framework/bin/MacOS/AnyCPU/Debug/MonoGame.Framework.dll' could not be found (CS0006) (MonoGame.Framework.Net.MacOS)

Additionally, the Platformer2D.csproj file defines DEBUG MONOMAC but not MONOMAC on its own, so I do not know if Program.cs(2): #if MONOMAC even works.

I also do not know if the using statements at the top of Program.cs are still valid now that Xamarin.Mac is a thing. I know that Microsoft's Xamarin "Hello_Mac" sample works just fine for me, so using AppKit; using Foundation; should be fine, but it seems that I would have to add Xamarin.Mac to the solution for that. I have not yet tried doing that.

Furthermore, the dotnet mgdesktopgl template builds just fine for me, so I am assuming that MonoMac/Xamarin.Mac is why Platformer2D refuses to build for me.

Build errors in VS2013

Hi,
My guess is that I'm missing some important step in getting started. I imported the project in VS2013 and when I try and build I get 50 errors, all like:

 Error  46  Could not copy the file 
"F:\git\MonoGame.Samples\ContentBuilder\bin\Windows\Content\Tiles\Platform.xnb" because it was not found.   
Platformer2D

I followed the instructions here (http://msxna.codeplex.com/releases/view/117230) but no luck. I can see .xnb files in the VS Solution Explorer window but clicking on them gives a file not found error.

I understand everyone is busy getting things into this repo but a very simple walkthrough on how to start from zero would be really helpful.

Thanks,
Chris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.