Доработана угадайка, добавлена змейка

This commit is contained in:
2024-12-22 11:40:58 +04:00
parent d1ebd91521
commit f7342093af
10 changed files with 385 additions and 406 deletions

View File

@@ -10,6 +10,7 @@ class Program
static MenuForm snakeSizeMenuForm;
static AboutMeForm aboutMeForm;
static MathGameForm mathGameForm;
static SnakeForm snakeForm;
[STAThread] // Требуется для Windows Forms
static void Main()
@@ -19,7 +20,7 @@ class Program
int sizex = 20;
int sizey = 20;
SnakeGame.Level difficulty = 0;
SnakeForm.Level difficulty = 0;
Menu sizeMenu = new Menu("Select world size");
sizeMenu.AddOption("Small size (10x10)", () => { sizex = 10; sizey = 10; });
@@ -27,9 +28,9 @@ class Program
sizeMenu.AddOption("Big size (40x20)", () => { sizex = 40; sizey = 20; });
Menu difficultyMenu = new Menu("Select difficulty");
difficultyMenu.AddOption("Easy", () => { difficulty = SnakeGame.Level.Low; });
difficultyMenu.AddOption("Medium", () => { difficulty = SnakeGame.Level.Medium; });
difficultyMenu.AddOption("Hard", () => { difficulty = SnakeGame.Level.High; });
difficultyMenu.AddOption("Easy", () => { difficulty = SnakeForm.Level.Low; });
difficultyMenu.AddOption("Medium", () => { difficulty = SnakeForm.Level.Medium; });
difficultyMenu.AddOption("Hard", () => { difficulty = SnakeForm.Level.High; });
Menu mainMenu = new Menu("Select option");
mainMenu.AddOption("Guess answer math game", () => mainMenuForm.SwitchToForm(mathGameForm));
@@ -50,9 +51,8 @@ class Program
snakeSizeMenuForm = new MenuForm(sizeMenu, () =>
{
snakeSizeMenuForm.Hide();
SnakeGame game = new SnakeGame(difficulty, sizex, sizey);
game.start();
snakeSizeMenuForm.SwitchToForm(mainMenuForm);
snakeForm = new SnakeForm(difficulty, sizex, sizey, mainMenuForm);
snakeForm.Show();
});
aboutMeForm = new AboutMeForm(mainMenuForm);
@@ -71,7 +71,7 @@ Website: divan2000.su";
}
private static void Exit()
{
ExitDialog.Exit();
Dialogs.Exit();
}
private static bool ExitMenu()
{