它说
“方法必须有返回类型”
每当我尝试调试它时。
我不知道如何修复这个类
这是 ac# 编码的 2d 游戏的玩家类
public class player
{
public float moveSpeed;
public Vector2 position;
public Texture2D texture;
//default constructer
public Player(Texture2D tex, Vector2 startPos)
{
position = startPos;
texture = tex;
moveSpeed = 5.0f;
}
public void Update(GameTime gameTime)
{
//------------------------------------------
//check for keyboard input(keyboard IF statements)
}
public void Draw(SpriteBatch spriteBatch)
{
spriteBatch.Draw(texture, position, Color.White);
}
}