Exemplo n.º 1
0
    static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 768, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == WelcomeScreen.OPTION_PLAY)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == WelcomeScreen.OPTION_HELP)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == WelcomeScreen.OPTION_CREDITS)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
        }while (w.GetChosenOption() != WelcomeScreen.OPTION_QUIT);
    }
Exemplo n.º 2
0
 public override void DrawMenu()
 {
     SdlHardware.ClearScreen();
     SdlHardware.WriteHiddenText("1. " + SLOTS[0].name,
                                 100, 20,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("2. " + SLOTS[1].name,
                                 100, 40,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("3. " + SLOTS[2].name,
                                 100, 60,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Name: " + name,
                                 100, 100,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     if (nameChosen || !newGame)
     {
         SdlHardware.WriteHiddenText("Choose slot: " + showSlot,
                                     100, 120,
                                     0xC0, 0xC0, 0xC0,
                                     font);
     }
     SdlHardware.WriteHiddenText("Note: SPACEBAR to delete",
                                 100, 200,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.ShowHiddenScreen();
 }
Exemplo n.º 3
0
    public void ChooseName()
    {
        //DateTime pressTic, drawTic;
        //TimeSpan diff;
        //pressTic = DateTime.Now;
        //drawTic = DateTime.Now;
        //diff = drawTic - pressTic;
        int key = SdlHardware.DetectKey();

        if (key != SdlHardware.KEY_SPC && key != SdlHardware.KEY_ESC &&
            key != SdlHardware.KEY_UP && key != SdlHardware.KEY_DOWN &&
            key != SdlHardware.KEY_LEFT && key != SdlHardware.KEY_RIGHT &&
            key != SdlHardware.KEY_RETURN /*&& ((int) diff.TotalMilliseconds > 500)*/)
        {
            name += SdlHardware.KeyToString(key);
        }
        else if (key == SdlHardware.KEY_SPC && name.Length > 0)
        {
            name = name.Remove(name.Length - 1);
        }
        else if (key == SdlHardware.KEY_RETURN)
        {
            nameChosen = true;
        }
        SdlHardware.Pause(105);
    }
Exemplo n.º 4
0
    private void GanarCombate()
    {
        do
        {
            DibujarInterfaz();

            SdlHardware.WriteHiddenText(salvaje.GetNombre() + " enemigo se ha debilitado",
                                        80, 560,
                                        0xC0, 0xC0, 0xC0,
                                        font35);
            SdlHardware.WriteHiddenText("¡Has ganado!",
                                        80, 590,
                                        0xC0, 0xC0, 0xC0,
                                        font35);
            SdlHardware.ShowHiddenScreen();
        } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
        SdlHardware.Pause(100);
        int dineroGanado = r.Next(cantidadMinima, cantidadMaxima);

        do
        {
            DibujarInterfaz();

            SdlHardware.WriteHiddenText("Obtienes " + dineroGanado + " PokeDólares",
                                        80, 560,
                                        0xC0, 0xC0, 0xC0,
                                        font35);
            SdlHardware.ShowHiddenScreen();
        } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
        prota.SetDinero(prota.GetDinero() + dineroGanado);
        continuar = false;
        SdlHardware.Pause(60);
    }
Exemplo n.º 5
0
    public static void CheckInputDevices()
    {
        // Read keys and calculate new position
        if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT) &&
            CanMoveTo(x + pacSpeed, y, map))
        {
            x += pacSpeed;
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT) &&
            CanMoveTo(x - pacSpeed, y, map))
        {
            x -= pacSpeed;
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN) &&
            CanMoveTo(x, y + pacSpeed, map))
        {
            y += pacSpeed;
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_UP) &&
            CanMoveTo(x, y - pacSpeed, map))
        {
            y -= pacSpeed;
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
        {
            gameFinished = true;
        }
    }
Exemplo n.º 6
0
 public void WriteOnHistory(string s)
 {
     history.Enqueue(s);
     history.Dequeue();
     UpdateScreen();
     SdlHardware.Pause(1000);
 }
Exemplo n.º 7
0
 public void UpdateScreen()
 {
     SdlHardware.ClearScreen();
     DrawMenu();
     ShowHistory();
     SdlHardware.ShowHiddenScreen();
 }
Exemplo n.º 8
0
    public static void Main(string[] args)
    {
        bool fullScreen = false;

        SdlHardware.Init(960, 750, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == 1)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == 2)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == 3)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
        } while (w.GetChosenOption() != 4);
    }
Exemplo n.º 9
0
    void CheckUserInput()
    {
        if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
        {
            if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT))
            {
                player.JumpRight(room);
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT))
            {
                player.JumpLeft(room);
            }
            else
            {
                player.Jump(room);
            }
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT))
        {
            player.MoveRight(room);
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT))
        {
            player.MoveLeft(room);
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
        {
            finished = true;
        }
    }
Exemplo n.º 10
0
    public void Run()
    {
        DrawWelcomeScreen(false);
        do
        {
            if (SdlHardware.KeyPressed(SdlHardware.KEY_1))
            {
                option = 1;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_2))
            {
                option = 2;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_3))
            {
                option = 3;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_Q))
            {
                option = 4;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_0) && activeTricks)
            {
                option = 5;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_Z))
            {
                activeTricks = true;
                DrawWelcomeScreen(true);
            }


            SdlHardware.Pause(100); // To avoid using 100% CPU
        }while (option == 0);
    }
Exemplo n.º 11
0
    public void IntroducirNombre()
    {
        do
        {
            if (!nombreIntroducido)
            {
                SdlHardware.ClearScreen();
                SdlHardware.DrawHiddenImage(bg, 0, 0);
                SdlHardware.WriteHiddenText("Introduce tu nombre. ",
                                            100, 100,
                                            0xC0, 0xC0, 0xC0,
                                            font24);

                SdlHardware.WriteHiddenText("Pulsa espacio al terminar.",
                                            50, 200,
                                            0xC0, 0xC0, 0xC0,
                                            font24);
                SdlHardware.WriteHiddenText(nombrePJ,
                                            100, 300,
                                            0xC0, 0xC0, 0xC0,
                                            font24);
                SdlHardware.WriteHiddenText(errorNombre,
                                            30, 400,
                                            0xC0, 0xC0, 0xC0,
                                            font24);
                SdlHardware.ShowHiddenScreen();
                IntroducirTecla();
            }
            SdlHardware.Pause(100);
        } while (!nombreIntroducido);
    }
Exemplo n.º 12
0
    public static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 720, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == 1)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == 2)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
            else if (w.GetChosenOption() == 3)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == 4)
            {
                ScoreBoard sb = new ScoreBoard();
                sb.Run();
            }
        } while (w.GetChosenOption() != 5);
    }
Exemplo n.º 13
0
 public void Run(ref bool finished)
 {
     option = 0;
     DrawMenu();
     do
     {
         if (SdlHardware.KeyPressed(SdlHardware.KEY_1))
         {
             SaveMenu save = new SaveMenu(playerToSave, false);
             SdlHardware.Pause(200);
             save.Run();
         }
         if (SdlHardware.KeyPressed(SdlHardware.KEY_2))
         {
             ChangeControlsMenu changeControls = new ChangeControlsMenu();
             changeControls.Run();
         }
         if (SdlHardware.KeyPressed(SdlHardware.KEY_3))
         {
             finished = true;
         }
         SdlHardware.Pause(100);
     }
     while (!SdlHardware.KeyPressed(Controls.Cancel) && !finished);
     SdlHardware.Pause(200);
 }
Exemplo n.º 14
0
    public void DrawOnHiddenScreen()
    {
        for (int row = 0; row < mapHeight; row++)
        {
            for (int col = 0; col < mapWidth; col++)
            {
                int posX = col * tileWidth + leftMargin;
                int posY = row * tileHeight + topMargin;
                switch (levelData[row][col])
                {
                case '1': SdlHardware.DrawHiddenImage(wallL1, posX, posY); break;

                case '2': SdlHardware.DrawHiddenImage(wallL2, posX, posY); break;

                case 'A': SdlHardware.DrawHiddenImage(floor1, posX, posY); break;

                case 'B': SdlHardware.DrawHiddenImage(floor2, posX, posY); break;

                case '|': SdlHardware.DrawHiddenImage(column, posX, posY); break;

                case '[': SdlHardware.DrawHiddenImage(platform1, posX, posY); break;

                case ']': SdlHardware.DrawHiddenImage(platform2, posX, posY); break;
                }
            }
        }
    }
Exemplo n.º 15
0
    public void SaveMenu()
    {
        int       optionSave        = 0;
        const int YSECONDCURSOR_MAX = 2;
        const int YSECONDCURSOR_MIN = 0;

        SdlHardware.Pause(100);
        do
        {
            SdlHardware.DrawHiddenImage(greyBackground, 0, 0);
            SdlHardware.DrawHiddenImage(saveBackground, -100, 0);
            SdlHardware.DrawHiddenImage(selector, 200, 270 + 120 * optionSave);
            SdlHardware.ShowHiddenScreen();
            if (SdlHardware.KeyPressed(SdlHardware.KEY_W) && optionSave >
                YSECONDCURSOR_MIN)
            {
                optionSave--;
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_S) && optionSave <
                     YSECONDCURSOR_MAX)
            {
                optionSave++;
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_RETURN))
            {
                Oneiric.SaveGame("data/savedGames/" + (optionSave + 1) + "_game.save");
            }
            SdlHardware.Pause(100);
        } while (!SdlHardware.KeyPressed(SdlHardware.KEY_ESC));
    }
Exemplo n.º 16
0
    public static void Run(int score, int maxScore)
    {
        SdlHardware.ClearScreen();

        SdlHardware.WriteHiddenText(ChooseLanguage.lenguage["score"] +
                                    " " + score,
                                    400, 350,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.WriteHiddenText(ChooseLanguage.lenguage["maxScore"] +
                                    " " + maxScore,
                                    400, 300,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.WriteHiddenText("Q. " + ChooseLanguage.lenguage["quit"],
                                    400, 530,
                                    0x80, 0x80, 0x80,
                                    font24);

        SdlHardware.ShowHiddenScreen();

        do
        {
            if (SdlHardware.KeyPressed(SdlHardware.KEY_Q))
            {
                exit = 0;
            }
            SdlHardware.Pause(100);
        }while (exit != 0);
    }
Exemplo n.º 17
0
    public int Run()
    {
        option = 0;
        LoadText(Oneiric.Languages[Oneiric.Language], "mainMenu");

        do
        {
            SdlHardware.ClearScreen();
            MoveLetters();
            DrawMenu();
            SdlHardware.ShowHiddenScreen();
            if (SdlHardware.KeyPressed(SdlHardware.KEY_W) && option >
                YCURSOR_MIN)
            {
                option--;
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_S) && option <
                     YCURSOR_MAX)
            {
                option++;
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
            {
                option = YCURSOR_MAX;
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_RETURN))
            {
                return(option);
            }
            SdlHardware.Pause(100);
        }while (true);
        //The loop ends when an option is choosed.
    }
Exemplo n.º 18
0
 public void Run()
 {
     font24 = new Font("data/Joystix.ttf", 18);
     SdlHardware.ClearScreen();
     // SdlHardware.DrawHiddenImage();
     SdlHardware.WriteHiddenText("LEFT and RIGHT arrows to move",
                                 300, 290,
                                 0xC0, 0xC0, 0xC0,
                                 font24);
     SdlHardware.WriteHiddenText("Spacebar to jump",
                                 300, 330,
                                 0xA0, 0xA0, 0xA0,
                                 font24);
     SdlHardware.WriteHiddenText("Fire still not available",
                                 300, 370,
                                 0xA0, 0xA0, 0xA0,
                                 font24);
     SdlHardware.WriteHiddenText("R - Return to Welcome ",
                                 300, 410,
                                 0x80, 0x80, 0x80,
                                 font24);
     SdlHardware.ShowHiddenScreen();
     do
     {
         SdlHardware.Pause(100); // To avoid using 100% CPU
     } while (!SdlHardware.KeyPressed(SdlHardware.KEY_R));
 }
Exemplo n.º 19
0
    public void Run()
    {
        bool endBattle = false;

        LoadText(Oneiric.Languages[Oneiric.Language], "battleTexts");

        SdlHardware.Pause(100);
        PrepareBattle();
        do
        {
            bool endPlayerTurn = false;
            do
            {
                PlayerTurn(ref endBattle, ref endPlayerTurn);
                UpdateScreen();
                SdlHardware.Pause(100);
            } while (!endPlayerTurn);

            SdlHardware.Pause(500);
            if (!endBattle)
            {
                EnemyTurn(ref endBattle);
                UpdateScreen();
                SdlHardware.Pause(100);
            }
        }while (!endBattle);
    }
Exemplo n.º 20
0
    void UpdateScreen()
    {
        SdlHardware.ClearScreen();
        room.DrawOnHiddenScreen();

        SdlHardware.WriteHiddenText("Score: ",
                                    40, 10,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        SdlHardware.WriteHiddenText("Press H for Help",
                                    780, 10,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        player.DrawOnHiddenScreen();
        for (int i = 0; i < numEnemies; i++)
        {
            enemies[i].DrawOnHiddenScreen();
        }
        for (int j = 0; j < bombs.Count; j++)
        {
            bombs[j].DrawOnHiddenScreen();
        }

        SdlHardware.ShowHiddenScreen();
    }
Exemplo n.º 21
0
 public void PlayerTurn(ref bool endBattle, ref bool endPlayerTurn)
 {
     if (protecting)
     {
         Oneiric.g.Mcharacter.Defense /= 2;
     }
     if (SdlHardware.KeyPressed(SdlHardware.KEY_W) && option >
         YCURSOR_MIN)
     {
         option--;
     }
     else if (SdlHardware.KeyPressed(SdlHardware.KEY_S) && option <
              YCURSOR_MAX)
     {
         option++;
     }
     else if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
     {
         option = YCURSOR_MAX;
     }
     else if (SdlHardware.KeyPressed(SdlHardware.KEY_RETURN))
     {
         SelectedOption(ref endBattle, ref endPlayerTurn);
     }
 }
Exemplo n.º 22
0
    public void Run()
    {
        Image credits = new Image("data/credits.png");
        Font  font18  = new Font("data/Joystix.ttf", 18);
        Font  font40  = new Font("data/Joystix.ttf", 40);

        player = new Player();
        player.MoveTo(80, 538);
        player.SetSpeed(50, 0);

        do
        {
            SdlHardware.ClearScreen();
            SdlHardware.DrawHiddenImage(credits, 0, 0);
            SdlHardware.WriteHiddenText("Thanks for playing",
                                        50, 30,
                                        0xCC, 0xCC, 0xCC,
                                        font18);
            SdlHardware.WriteHiddenText("Press R to Return",
                                        680, 30,
                                        0xCC, 0xCC, 0xCC,
                                        font18);
            SdlHardware.WriteHiddenText("Trivial by María",
                                        220, 640,
                                        0xCC, 0xCC, 0xCC,
                                        font40);
            player.DrawOnHiddenScreen();
            SdlHardware.ShowHiddenScreen();

            player.Move();

            SdlHardware.Pause(100);
        } while (!SdlHardware.KeyPressed(SdlHardware.KEY_R));
    }
Exemplo n.º 23
0
 private void ComprobarPoderHuir()
 {
     if (r.Next(1, 100) >= 50 ? true : false)
     {
         do
         {
             DibujarInterfaz();
             SdlHardware.WriteHiddenText("¡No has podido escapar!",
                                         100, 560,
                                         0xC0, 0xC0, 0xC0,
                                         font35);
             SdlHardware.ShowHiddenScreen();
         } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
     }
     else
     {
         do
         {
             DibujarInterfaz();
             SdlHardware.WriteHiddenText("Escapaste sin problemas",
                                         100, 560,
                                         0xC0, 0xC0, 0xC0,
                                         font35);
             SdlHardware.ShowHiddenScreen();
         } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
         continuar = false;
     }
 }
Exemplo n.º 24
0
    public void Run()
    {
        Sound bgSound = new Sound("data/sonidos/pantalla_titulo.mp3");

        bgSound.BackgroundPlay();
        do
        {
            SdlHardware.ClearScreen();

            SdlHardware.DrawHiddenImage(bg, 0, 0);
            SdlHardware.WriteHiddenText("Pulsa Espacio para",
                                        100, 550,
                                        0xC0, 0xC0, 0xC0,
                                        font24);
            SdlHardware.WriteHiddenText("Continuar",
                                        200, 600,
                                        0xC0, 0xC0, 0xC0,
                                        font24);

            SdlHardware.ShowHiddenScreen();

            SdlHardware.Pause(1);
        } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
        bgSound.StopMusic();
        SdlHardware.Pause(100);
    }
Exemplo n.º 25
0
    void CheckUserInput()
    {
        if (SdlHardware.KeyPressed(SdlHardware.KEY_Q))
        {
            finished = true;
        }

        if (SdlHardware.KeyPressed(SdlHardware.KEY_H))
        {
            HelpScreen help = new HelpScreen();
            help.Run();
        }

        if (canThrowDice)
        {
            if (SdlHardware.KeyPressed(SdlHardware.KEY_D))
            {
                // Wait if key D is pressed
                while (SdlHardware.KeyPressed(SdlHardware.KEY_D))
                {
                }
                ChangeTurn();
            }
        }
    }
Exemplo n.º 26
0
    public void ChooseNewKey()
    {
        if (!Controls.CheckKeysInUse())
        {
            DrawMenu();
            DrawBottomMessage("Invalid key. Choose again");
            keyToChange       = -1;
            currentKeyChoosen = false;
        }
        else
        {
            do
            {
                DrawMenu();
                DrawBottomMessage("Press the new key");
                pressedKey = SdlHardware.DetectKey();
            }while (pressedKey < 0);

            if (pressedKey < 0)
            {
                DrawMenu();
                DrawBottomMessage("Invalid Key");
            }
            else
            {
                DrawMenu();
                DrawBottomMessage("Key changed");
                Controls.SwapKeys(keyToChange, pressedKey);
                newKeyChoosen = true;
            }
            SdlHardware.Pause(30);
        }
    }
Exemplo n.º 27
0
    public void Run()
    {
        do
        {
            DrawMenu();
            if (newGame)
            {
                do
                {
                    DrawMenu();
                    if (!nameChosen) // when newGame == false there is no need to ask for a name
                    {
                        ChooseName();
                    }
                } while (!SdlHardware.KeyPressed(Controls.Accept));
            }

            if (nameChosen || !newGame)
            {
                do
                {
                    do
                    {
                        selectedSlot = ChooseSlot();
                        DrawMenu();
                        if (selectedSlot != 0)
                        {
                            SdlHardware.Pause(200);
                        }
                    } while (selectedSlot == 0);
                } while (!SdlHardware.KeyPressed(Controls.Accept));
            }
        } while (!SdlHardware.KeyPressed(Controls.Cancel) && selectedSlot == 0);
        Save(SLOTS[selectedSlot - 1]);
    }
Exemplo n.º 28
0
    public void DrawElements()
    {
        SdlHardware.ClearScreen();

        SdlHardware.DrawHiddenImage(backgroundImage, 100, 50);

        SdlHardware.WriteHiddenText(("Score: " + score),
                                    40, 10,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        if (cheatTime > 0)
        {
            SdlHardware.WriteHiddenText(cheatInfo,
                                        40, 720,
                                        0xCC, 0xCC, 0xCC,
                                        font18);
            cheatTime--;
        }

        for (int i = 0; i < SIZEENEMY; i++)
        {
            e[i].DrawOnHiddenScreen();
        }

        player.DrawOnHiddenScreen();

        if (player.GetFire().IsVisible())
        {
            player.GetFire().Move();
            player.GetFire().DrawOnHiddenScreen();
        }

        SdlHardware.ShowHiddenScreen();
    }
Exemplo n.º 29
0
    public int ChooseSlot()
    {
        int selectedSlotKey = SdlHardware.DetectKey();

        if (selectedSlotKey == SdlHardware.KEY_1)
        {
            selectedSlot = 1;
            showSlot     = "1";
        }
        if (selectedSlotKey == SdlHardware.KEY_2)
        {
            selectedSlot = 2;
            showSlot     = "2";
        }
        if (selectedSlotKey == SdlHardware.KEY_3)
        {
            selectedSlot = 3;
            showSlot     = "3";
        }
        if (selectedSlot != 0)
        {
            playerToSave.SetName(name);
            SLOTS[selectedSlot - 1].name     = name;
            SLOTS[selectedSlot - 1].fileName = "slot1" + name + ".txt";
            SaveSlotsInfo();
        }

        return(selectedSlot);
    }
Exemplo n.º 30
0
 public void Run()
 {
     option = 0;
     DrawMenu();
     do
     {
         if (SdlHardware.KeyPressed(SdlHardware.KEY_1))
         {
             option = 1;
         }
         if (SdlHardware.KeyPressed(SdlHardware.KEY_2))
         {
             option = 2;
         }
         if (SdlHardware.KeyPressed(SdlHardware.KEY_3))
         {
             option = 3;
         }
         if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
         {
             option = 4;
         }
         SdlHardware.Pause(100);
     }while (option == 0);
 }