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