0
我在这堂课做错了什么?我使用monogame和C#,但我的对象不会在程序中呈现。我在这个Monogame课上做错了什么?
class Player : Game
{
Texture2D PlayerSprite;
Vector2 PlayerPosition;
public Player()
{
Content.RootDirectory = "Content";
PlayerSprite = Content.Load<Texture2D>("spr_Player");
PlayerPosition = Vector2.Zero;
}
public void Update()
{
}
public void Draw(SpriteBatch SpriteBatch)
{
SpriteBatch.Begin();
SpriteBatch.Draw(PlayerSprite,PlayerPosition, new Rectangle(0, 0, 32,32), Color.White);
SpriteBatch.End();
}
}
你得到一个错误? – CodingYoshi
没有错误,当我编译时它不显示我的对象。在另一个叫做player的类中,我应该引用Game1类中的其他类吗? –
@Liam Earle,你在哪里创建一个播放器? – vyrp