MonoGame – Use a new class in the base example.

In the last tutorial, I showed you how to instantiate a project in MonoGame.
In today’s tutorial, I will show you how to create a file with a class and implement it in the basic project.
Create a file in the folder named MyGame001 and rename this file ProblemReport.cs.
Add this source code to this file.

This created class can be used in various C# files, but now as an example, I have added it in the Game1.cs file:

You can see how the C# files were created to run the application correctly:

First on run is Program.cs then Game1.cs with the class ProblemReport from ProblemReport.cs.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.