我正在使用XNA编写自己的游戏引擎,并开始将其移植到MonoGame上,以便在Android / iOS / Windows 8上使用。但是在创建新游戏对象时,出现了空引用异常。因此,分配对象的代码如下:
static void Main(string[] args)
{
//game g = new game();
using (game game = new game())
{
game.Run();
}
}
错误信息如下:
public lesaEngine()
这是游戏对象的基本构造函数。
继承方式与往常一样。
class lesaEngine : Microsoft.Xna.Framework.Game
class game : lesaEngine
不确定这里发生了什么。在正常的XNA下工作正常。我正在使用Visual Studio 2012进行移植。