添加模式选择开始菜单并修复中文界面乱码

This commit is contained in:
2026-04-24 17:29:10 +08:00
parent 678285206b
commit 8f651e896e
4 changed files with 257 additions and 110 deletions
+23
View File
@@ -11,6 +11,9 @@ bool targetFlag = false;
int workRegion[20][10] = { 0 };
Point point = { 0, 0 };
Point target = { 0, 0 };
MenuState menuState = { 0, 2 };
int currentScreen = SCREEN_MENU;
int currentMode = MODE_CLASSIC;
int bricks[7][4][4][4] =
{
@@ -516,3 +519,23 @@ void Restart()
ComputeTarget();
}
void StartGameWithMode(int mode)
{
currentMode = mode;
currentScreen = SCREEN_PLAYING;
Restart();
}
void ReturnToMainMenu()
{
currentScreen = SCREEN_MENU;
suspendFlag = false;
gameOverFlag = false;
menuState.optionCount = 2;
if (menuState.selectedIndex < 0 || menuState.selectedIndex >= menuState.optionCount)
{
menuState.selectedIndex = 0;
}
}