我得到上述錯誤,這阻止了我測試以查看我的相機是否工作。該代碼是:沒有合適的方法來覆蓋更新(GameTime gameTime)
protected override void Update(GameTime gameTime)
{
KeyboardState keyBoardState = Keyboard.GetState();
//Rotate Cube along its Up Vector
if (keyBoardState.IsKeyDown(Keys.X))
{
cubeWorld = Matrix.CreateFromAxisAngle(Vector3.Up, .02f) * cubeWorld;
}
if (keyBoardState.IsKeyDown(Keys.Z))
{
cubeWorld = Matrix.CreateFromAxisAngle(Vector3.Up, -.02f) * cubeWorld;
}
//Move Cube Forward, Back, Left, and Right
if (keyBoardState.IsKeyDown(Keys.Up))
{
cubeWorld *= Matrix.CreateTranslation(cubeWorld.Forward);
}
if (keyBoardState.IsKeyDown(Keys.Down))
{
cubeWorld *= Matrix.CreateTranslation(cubeWorld.Backward);
}
if (keyBoardState.IsKeyDown(Keys.Left))
{
cubeWorld *= Matrix.CreateTranslation(-cubeWorld.Right);
}
if (keyBoardState.IsKeyDown(Keys.Right))
{
cubeWorld *= Matrix.CreateTranslation(cubeWorld.Right);
}
}
導致錯誤的行是:
protected override void Update(GameTime gameTime)
你確定你的基類有你想要覆蓋的方法? – ebutusov 2012-03-09 13:09:52