We start by creating the Game.cs file that will contain shared code. Let's set this up by going through the following steps:
- In the WhackABox project, create a new file called Game.cs in the root of the project.
- Add the following code to the class:
using System;
using System.Linq;
using Urho;
using Urho.Shapes;
namespace WhackABox
{
public abstract class Game : Application
{
protected Scene scene;
public Game(ApplicationOptions options) : base(options)
{
}
}
}
The Game inherits from Urho.Application, which will do most of the work regarding the game itself. We define a property called scene, of the Scene type. A Scene in Urho represents one screen of the game (we could have different scenes for different parts of a game or for a menu, for example). In this game, we will only be defining one scene, which will be initialized later. A scene maintains a hierarchy of nodes that compose it, and each...