Пример #1
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);
    }
Пример #2
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;
     }
 }
Пример #3
0
 void UpdateScreen()
 {
     SdlHardware.ClearScreen();
     room.DrawOnHiddenScreen();
     player.DrawOnHiddenScreen();
     SdlHardware.ShowHiddenScreen();
 }
Пример #4
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();
    }
Пример #5
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();
 }
Пример #6
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.
    }
Пример #7
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));
    }
Пример #8
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);
    }
Пример #9
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));
    }
Пример #10
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();
    }
Пример #11
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));
 }
Пример #12
0
 public void UpdateScreen()
 {
     SdlHardware.ClearScreen();
     DrawMenu();
     ShowHistory();
     SdlHardware.ShowHiddenScreen();
 }
Пример #13
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);
    }
Пример #14
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);
    }
Пример #15
0
    private void CapturarPokemon()
    {
        SdlHardware.Pause(100);
        capturando = true;
        bool   haEscapado   = false;
        int    tickBall     = 1;
        string cadenaPuntos = "";

        do
        {
            DibujarInterfaz();
            SdlHardware.WriteHiddenText("Capturando a " + salvaje.GetNombre(),
                                        100, 560,
                                        0xC0, 0xC0, 0xC0,
                                        font35);
            for (int i = 0; i < tickBall; i++)
            {
                cadenaPuntos += ". ";
            }

            SdlHardware.WriteHiddenText(cadenaPuntos,
                                        100, 590,
                                        0xC0, 0xC0, 0xC0,
                                        font35);

            SdlHardware.ShowHiddenScreen();

            if (r.Next(1, 100) >= 70 ? true : false)
            {
                haEscapado = true;
            }
            else
            {
                tickBall++;
            }
            if (tickBall == 3)
            {
                capturando = false;
            }
        } while (capturando && !haEscapado);

        if (haEscapado)
        {
            do
            {
                DibujarInterfaz();
                SdlHardware.WriteHiddenText("¡El pokemon ha escapado!",
                                            100, 560,
                                            0xC0, 0xC0, 0xC0,
                                            font35);
                SdlHardware.ShowHiddenScreen();
            } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
            capturando = false;
        }
        else
        {
            PokemonCapturado();
        }
    }
Пример #16
0
    public void Run()
    {
        SdlHardware.ClearScreen();
        SdlHardware.DrawHiddenImage(loginImage, 340, 300);
        SdlHardware.ShowHiddenScreen();

        SdlHardware.Pause(3000);
    }
Пример #17
0
    public static void Main(string[] args)
    {
        SdlHardware.Init(1024, 768, 24, false);

        int xShip       = 500;
        int xEnemy      = 400;
        int xEnemy2     = 200;
        int enemySpeed  = 5;
        int enemySpeed2 = -3;
        int finished    = 0;

        Image ship   = new Image("data/ship.png");
        Image enemy1 = new Image("data/enemy1a.png");
        Image enemy2 = new Image("data/enemy2a.png");

        do
        {
            // Draw elements
            SdlHardware.ClearScreen();
            SdlHardware.DrawHiddenImage(enemy1, xEnemy, 200);
            SdlHardware.DrawHiddenImage(enemy2, xEnemy2, 250);
            SdlHardware.DrawHiddenImage(ship, xShip, 500);
            SdlHardware.ShowHiddenScreen();

            // Process user input
            if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
            {
                finished = 1;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_RIGHT))
            {
                xShip += 10;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_LEFT))
            {
                xShip -= 10;
            }

            // Update world
            if ((xEnemy <= 50) || (xEnemy >= 950))
            {
                enemySpeed = -enemySpeed;
            }
            xEnemy += enemySpeed;

            if ((xEnemy2 <= 50) || (xEnemy2 >= 950))
            {
                enemySpeed2 = -enemySpeed2;
            }
            xEnemy2 += enemySpeed2;

            // Check game status
            // (Not yet)

            // Pause until next frame
            SdlHardware.Pause(20);
        }while (finished == 0);
    }
Пример #18
0
    public void DetectarTeclas()
    {
        if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN))
        {
            if (seleccion == maxOpciones)
            {
                seleccion      = 1;
                posicionFlecha = 200;
            }
            else
            {
                seleccion++;
                posicionFlecha += 50;
            }
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_UP))
        {
            if (seleccion == 1)
            {
                seleccion      = maxOpciones;
                posicionFlecha = 500;
            }
            else
            {
                seleccion--;
                posicionFlecha -= 50;
            }
        }
        SdlHardware.ShowHiddenScreen();
        if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
        {
            switch (seleccion)
            {
            case 1:; Pokedex p = new Pokedex(prota); p.Run(); break;

            case 2: EquipoJugador ej = new EquipoJugador(prota); ej.Run(); break;

            case 3: VerMochila(); break;

            case 4: InformacionJugador ij = new InformacionJugador(prota); ij.Run(); break;

            case 5: prota.guardarJugador("partidas/" + prota.GetNombre() +
                                         ".txt", ref fondo, ref dialogo, juego.viejoScrollX, juego.viejoScrollY);
                GuardadoCompletado(); break;

            case 6: Instrucciones i = new Instrucciones(); i.Run(); break;

            case 7: continuar = false;; break;
            }
            SdlHardware.Pause(100);
        }
        if (SdlHardware.KeyPressed(Tao.Sdl.Sdl.SDLK_BACKSPACE))
        {
            SdlHardware.Pause(100);
            continuar = false;
        }
    }
Пример #19
0
 public void DetectarTeclas()
 {
     SdlHardware.ShowHiddenScreen();
     if (SdlHardware.KeyPressed(Tao.Sdl.Sdl.SDLK_BACKSPACE))
     {
         SdlHardware.Pause(100);
         continuar = false;
     }
 }
Пример #20
0
 public void DetectarTeclas()
 {
     SdlHardware.ShowHiddenScreen();
     if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
     {
         SdlHardware.Pause(100);
         continuar = false;
     }
 }
Пример #21
0
    void UpdateScreen()
    {
        SdlHardware.ClearScreen();
        Groom.DrawOnHiddenScreen();

        Mcharacter.DrawOnHiddenScreen();

        SdlHardware.ShowHiddenScreen();
    }
Пример #22
0
    private void TuTurno()
    {
        bool accion = false;

        do
        {
            DibujarInterfaz();
            DibujarTuTurno();
            SdlHardware.ShowHiddenScreen();

            if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN))
            {
                if (seleccion == 3)
                {
                    seleccion      = 0;
                    posicionFlecha = 560;
                }
                else
                {
                    seleccion++;
                    posicionFlecha += 50;
                }
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_UP))
            {
                if (seleccion == 0)
                {
                    seleccion      = 3;
                    posicionFlecha = 710;
                }
                else
                {
                    seleccion--;
                    posicionFlecha -= 50;
                }
            }
            SdlHardware.Pause(40);
        } while (!SdlHardware.KeyPressed(SdlHardware.KEY_SPC));
        SdlHardware.Pause(100);

        switch (seleccion)
        {
        case 0: TusAtaques(); break;

        case 1: CapturarPokemon(); break;

        case 2: AbrirMochila(ref accion);
            if (!accion)
            {
                TuTurno();
            }
            break;

        case 3: ComprobarPoderHuir(); break;
        }
    }
Пример #23
0
    public override void DibujarInterfaz()
    {
        SdlHardware.DrawHiddenImage(bg, 0, 0);
        SdlHardware.WriteHiddenText("Pokedex",
                                    100, 50,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.WriteHiddenText("Usa ARRIBA O ABAJO para desplazarte",
                                    100, 100,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText((seleccion + 1) + " de " + pokedex.Count,
                                    100, 150,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.WriteHiddenText(pokedex[seleccion],
                                    100, 250,
                                    0xC0, 0xC0, 0xC0,
                                    select);
        SdlHardware.DrawHiddenImage(dexImagenes[pokedex[seleccion]], 400, 250);

        SdlHardware.WriteHiddenText("Pulsa <-- para salir",
                                    100, 600,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.ShowHiddenScreen();

        if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN))
        {
            if (seleccion == pokedex.Count - 1)
            {
                seleccion = 0;
            }
            else
            {
                seleccion++;
            }
        }
        if (SdlHardware.KeyPressed(SdlHardware.KEY_UP))
        {
            if (seleccion == 0)
            {
                seleccion = pokedex.Count - 1;
            }
            else
            {
                seleccion--;
            }
        }

        SdlHardware.Pause(40);
    }
Пример #24
0
    public void Run()
    {
        // Display until the user presses ESC
        while (SdlHardware.KeyPressed(SdlHardware.KEY_ESC) == false)
        {
            SdlHardware.ClearScreen();
            SdlHardware.WriteHiddenText("Change option with up and down arrows, change selected option with space",
                                        40, 110,
                                        0xCC, 0xCC, 0xCC,
                                        font18);

            SdlHardware.WriteHiddenText("High Resolution Mode: " + (configuration[0] ? "YES" : "NO"),
                                        40, 310,
                                        (index == 0 ? (byte)0xCC : (byte)0xFF), 0xCC, 0xCC,
                                        font18);
            SdlHardware.ShowHiddenScreen();

            SdlHardware.Pause(50); // So that we do not use a 100% CPU

            if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN))
            {
                if (index < configuration.Length)
                {
                    index++;
                }
                else
                {
                    index = 0;
                }
            }

            if (SdlHardware.KeyPressed(SdlHardware.KEY_UP))
            {
                if (index > 0)
                {
                    index--;
                }
                else
                {
                    index = configuration.Length - 1;
                }
            }

            if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
            {
                configuration[index] = !configuration[index];
            }

            if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
            {
                return;
            }
        }
    }
Пример #25
0
    public static void Intro()
    {
        int  x         = -40;
        bool exitIntro = false;

        do
        {
            SdlHardware.ClearScreen();
            SdlHardware.WriteHiddenText("Hit SPACE to start",
                                        300, 400,
                                        0xCC, 0xCC, 0xCC,
                                        sans18);
            SdlHardware.WriteHiddenText("or H for Help",
                                        330, 440,
                                        0xAA, 0xAA, 0xAA,
                                        sans18);
            SdlHardware.WriteHiddenText("or C for Credits",
                                        310, 480,
                                        0x88, 0x88, 0x88,
                                        sans18);
            SdlHardware.WriteHiddenText("or Q to Quit",
                                        340, 520,
                                        0x66, 0x66, 0x66,
                                        sans18);

            SdlHardware.DrawHiddenImage(enemyImage[0], x - 50, 300);
            SdlHardware.DrawHiddenImage(pacImage, x, 300);
            SdlHardware.ShowHiddenScreen();
            x += 8;
            if (x > 850)
            {
                x = -40;
            }
            SdlHardware.Pause(20);
            if (SdlHardware.KeyPressed(SdlHardware.KEY_C))
            {
                ShowCredits();
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_H))
            {
                ShowHelp();
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
            {
                exitIntro = true;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_Q))
            {
                exitIntro       = true;
                sessionFinished = true;
            }
        }while (!exitIntro);
    }
Пример #26
0
    public void Run()
    {
        option = 0;
        SdlHardware.ClearScreen();
        SdlHardware.DrawHiddenImage(welcome, 100, 0);
        SdlHardware.WriteHiddenText("1. Play",
                                    30, 290,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("2. Credits",
                                    30, 330,
                                    0xA0, 0xA0, 0xA0,
                                    font24);
        SdlHardware.WriteHiddenText("3. Help",
                                    30, 370,
                                    0x80, 0x80, 0x80,
                                    font24);
        SdlHardware.WriteHiddenText("4. ScoreBoard",
                                    30, 410,
                                    0x80, 0x80, 0x80,
                                    font24);
        SdlHardware.WriteHiddenText("Q. Quit",
                                    30, 450,
                                    0x80, 0x80, 0x80,
                                    font24);
        SdlHardware.ShowHiddenScreen();

        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_4))
            {
                option = 4;
            }
            if (SdlHardware.KeyPressed(SdlHardware.KEY_Q))
            {
                option = 5;
            }
            SdlHardware.Pause(100); // To avoid using 100% CPU
        }while (option == 0);
    }
Пример #27
0
    public void Run()
    {
        SdlHardware.Pause(1000);

        SdlHardware.ClearScreen();
        SdlHardware.WriteHiddenText("Game over!",
                                    400, 300,
                                    0xCC, 0xCC, 0xCC,
                                    font18);
        SdlHardware.ShowHiddenScreen();

        SdlHardware.Pause(2000);
    }
Пример #28
0
 public void SeleccionGenero()
 {
     do
     {
         if (!generoIntroducido)
         {
             SdlHardware.ClearScreen();
             SdlHardware.DrawHiddenImage(bg2, 0, 0);
             SdlHardware.WriteHiddenText("<--",
                                         500, posicionFlecha,
                                         0xC0, 0xC0, 0xC0,
                                         font24);
             SdlHardware.ShowHiddenScreen();
             if (SdlHardware.KeyPressed(SdlHardware.KEY_DOWN))
             {
                 if (indiceGenero == 0)
                 {
                     indiceGenero++;
                 }
                 else
                 {
                     indiceGenero = 0;
                 }
                 posicionFlecha = posicionFlecha == 300 ?
                                  Convert.ToInt16(posicionFlecha + 250) : Convert.ToInt16(300);
                 SdlHardware.Pause(1);
             }
             if (SdlHardware.KeyPressed(SdlHardware.KEY_UP))
             {
                 if (indiceGenero == 1)
                 {
                     indiceGenero--;
                 }
                 else
                 {
                     indiceGenero = 1;
                 }
                 posicionFlecha = posicionFlecha == 550 ?
                                  Convert.ToInt16(posicionFlecha - 250) : Convert.ToInt16(550);
                 SdlHardware.Pause(1);
             }
             if (SdlHardware.KeyPressed(SdlHardware.KEY_SPC))
             {
                 generoIntroducido = true;
                 SdlHardware.Pause(1);
             }
             genero = indiceGenero == 0 ? "Hombre" : "Mujer";
         }
         SdlHardware.Pause(100);
     } while (!generoIntroducido);
 }
Пример #29
0
    public override void DibujarInterfaz()
    {
        SdlHardware.ClearScreen();
        SdlHardware.DrawHiddenImage(bg, 0, 0);
        SdlHardware.WriteHiddenText("Menú",
                                    100, 50,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Pulsa <-- para volver",
                                    100, 100,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Pokedex",
                                    100, 200,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Equipo",
                                    100, 250,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Mochila",
                                    100, 300,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Entrenador",
                                    100, 350,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Guardar Partida",
                                    100, 400,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Instrucciones",
                                    100, 450,
                                    0xC0, 0xC0, 0xC0,
                                    font24);
        SdlHardware.WriteHiddenText("Volver a la partida",
                                    100, 500,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.WriteHiddenText("-->",
                                    30, posicionFlecha,
                                    0xC0, 0xC0, 0xC0,
                                    font24);

        SdlHardware.ShowHiddenScreen();

        SdlHardware.Pause(40);
    }
Пример #30
0
    public void Run()
    {
        // TO DO: Display some Help. Wait for R to return.
        SdlHardware.Pause(1000);

        SdlHardware.ClearScreen();
        SdlHardware.WriteHiddenText("Help soon available",
                                    200, 100,
                                    0xCC, 0xCC, 0xCC,
                                    font18);
        SdlHardware.ShowHiddenScreen();

        SdlHardware.Pause(2000);
    }