这是我的代码: 变量:
//Game States
enum gameState
{
gameLoading,
mainMenu,
gameOptions,
levelSelect,
gamePlaying,
}
gameState CurrentGameState = gameState.gameLoading;
在Update()
方法中:
switch (CurrentGameState)
{
case gameState.gameLoading:
//My gameLoading state logic here
break;
//And so on the other states, etc mainMenu, gameOptions, levelSelect, gamePlaying
还有我的Draw()
方法:
switch (CurrentGameState)
{
case gameState.gameLoading:
//Draw gameLoading state here
break;
//And so on the other states, etc mainMenu, gameOptions, levelSelect, gamePlaying
所以我需要类似的东西if()
?和一个计时 30 秒的计时器,然后它调用 aspriteBatch.Draw()
在屏幕上绘制我的图像。