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));
    }
Example #2
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));
 }
Example #3
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);
    }
Example #4
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);
    }
Example #5
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);
    }
Example #6
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();
    }
Example #7
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);
    }
Example #8
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;
     }
 }
Example #9
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();
    }
Example #10
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();
 }
Example #11
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();
        }
    }
Example #12
0
 public void DrawBottomMessage(string message)
 {
     SdlHardware.WriteHiddenText(message,
                                 100, 230,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.Pause(200);
 }
Example #13
0
 public override void DrawOnHiddenScreen()
 {
     base.DrawOnHiddenScreen();
     SdlHardware.WriteHiddenText(Lives.ToString(),
                                 570, 640,
                                 0xC0, 0xC0, 0xC0,
                                 font24);
 }
Example #14
0
    public void DrawUnbeatable()
    {
        unbeatableY = y + 40;
        unbeatableX = x - 15;

        SdlHardware.WriteHiddenText(ChooseLanguage.lenguage["unbeatable"] + "",
                                    (short)unbeatableX, (short)unbeatableY,
                                    0xC0, 0xC0, 0xC0,
                                    font8);
    }
Example #15
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);
    }
Example #16
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;
            }
        }
    }
Example #17
0
 public void Draw()
 {
     SdlHardware.DrawHiddenImage(background, 0, 544);
     SdlHardware.WriteHiddenText(Time.ToString(), 733, 595,
                                 255, 255, 255, fontTime);
     SdlHardware.WriteHiddenText(Pay.ToString("0000000"), 470, 570,
                                 255, 255, 255, fontPay);
     // TO DO: Change for a decreasing bar
     SdlHardware.WriteHiddenText(Energy.ToString(), 420, 650,
                                 255, 255, 255, fontEnergy);
 }
Example #18
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);
    }
Example #19
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);
    }
Example #20
0
    public void Run()
    {
        SdlHardware.Pause(1000);

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

        SdlHardware.Pause(2000);
    }
Example #21
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);
 }
Example #22
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);
    }
Example #23
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);
    }
Example #24
0
    public void Run()
    {
        /*
         * Font font22 = new Font("data/Joystix.ttf", 22);
         * Font font16 = new Font("data/Joystix.ttf", 16);
         * Font font26 = new Font("data/Joystix.ttf", 26);
         * Font font28 = new Font("data/Joystix.ttf", 28);
         * Font font14 = new Font("data/Joystix.ttf", 14);
         */

        while (!finished)
        {
            nextName = false;

            SdlHardware.ClearScreen();
            SdlHardware.DrawHiddenImage(background, 0, 0);
            SdlHardware.WriteHiddenText("Credits",
                                        512, 10,
                                        0x20, 0xCC, 0x20,
                                        font24);
            yText = 40;
            for (int i = 0; i < names.Length; i++)
            {
                SdlHardware.WriteHiddenText(names[i],
                                            500, (short)(startY + yText),
                                            0xCC, 0xCC, 0x00,
                                            font18);
                yText += 22;
            }

            SdlHardware.WriteHiddenText("Press ESC to return...",
                                        50, (short)(yText + 15),
                                        0x00, 0xFF, 0x00,
                                        font18);
            SdlHardware.ShowHiddenScreen();

            SdlHardware.Pause(20);  // To avoid 100% CPU usage
            if (SdlHardware.KeyPressed(SdlHardware.KEY_ESC))
            {
                finished = true;
            }
            if (startY < -800)
            {
                finished = true;
            }

            startY -= 2;
        }
    }
Example #25
0
 public override void DrawMenu()
 {
     SdlHardware.ClearScreen();
     SdlHardware.WriteHiddenText("CURRENT CONTROLS ",
                                 100, 30,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Up: " + SdlHardware.KeyToString(Controls.Up),
                                 100, 40,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Down: " + SdlHardware.KeyToString(Controls.Down),
                                 100, 50,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Left: " + SdlHardware.KeyToString(Controls.Left),
                                 100, 60,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Right: " + SdlHardware.KeyToString(Controls.Right),
                                 100, 70,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Use item: " + SdlHardware.KeyToString(Controls.UseItem),
                                 100, 80,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Toggle walk: " + SdlHardware.KeyToString(Controls.ToggleWalk),
                                 100, 90,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Open inventory: " + SdlHardware.KeyToString(Controls.Inventory),
                                 100, 100,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Pause: " + SdlHardware.KeyToString(Controls.Pause),
                                 100, 110,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Accept: " + SdlHardware.KeyToString(Controls.Accept),
                                 100, 120,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.WriteHiddenText("Cancel: " + SdlHardware.KeyToString(Controls.Cancel),
                                 100, 130,
                                 0xC0, 0xC0, 0xC0,
                                 font);
     SdlHardware.ShowHiddenScreen();
 }
Example #26
0
    public void Run()
    {
        Font  font18     = new Font("data/Joystix.ttf", 18);
        Image background = new Image("data/imgRetro/intro.png");

        SdlHardware.ClearScreen();
        SdlHardware.DrawHiddenImage(background, 0, 0);
        SdlHardware.WriteHiddenText("Welcome to...",
                                    40, 10,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        SdlHardware.ShowHiddenScreen();
        SdlHardware.Pause(3000);
    }
Example #27
0
    private void DibujarJuego()
    {
        bool dibujarDialogo = false;
        Npc  npcHablando    = null;

        SdlHardware.ClearScreen();
        fondo.DrawOnHiddenScreen();
        foreach (Hierba hierba in mapa.Hierbas)
        {
            hierba.DrawOnHiddenScreen();
        }
        protagonista.DrawOnHiddenScreen();
        foreach (Arbol arbol in mapa.Arboles)
        {
            arbol.DrawOnHiddenScreen();
        }
        foreach (Edificio edificio in mapa.Edificios)
        {
            edificio.DrawOnHiddenScreen();
        }
        foreach (Pc pc in mapa.Pcs)
        {
            pc.DrawOnHiddenScreen();
        }


        foreach (Npc npc in mapa.Npcs)
        {
            npc.DrawOnHiddenScreen();
            if (npc.Hablando)
            {
                dibujarDialogo = true;
                npcHablando    = npc;
            }
        }

        if (dibujarDialogo && npcHablando.Dialogo.Count > 0)
        {
            dialogo.DrawOnHiddenScreen();
            SdlHardware.WriteHiddenText(
                npcHablando.Dialogo[npcHablando.IndiceDialogo],
                Convert.ToInt16(dialogo.x + 50), Convert.ToInt16(dialogo.y + 50),
                0, 0, 0,
                font18);
        }

        SdlHardware.ShowHiddenScreen();
    }
Example #28
0
    static void Main(string[] args)
    {
        bool fullScreen = false;

        SdlHardware.Init(640, 400, 24, fullScreen);
        Font font;

        font = new Font("data/Joystix.ttf", 12);

        MainMenu main = new MainMenu();
        Controls c    = new Controls();

        Controls.LoadControls();

        do
        {
            main.Run();


            if (main.GetChosenOption() == 1)
            {
                SdlHardware.Pause(20);
                SaveMenu newGame = new SaveMenu(new Player("data/adol.png"), true);
                newGame.Run();
                Game ys = new Game();
                ys.Run();
                SdlHardware.Pause(100);
            }
            else if (main.GetChosenOption() == 2)
            {
                SdlHardware.ClearScreen();
                SdlHardware.WriteHiddenText("Work in progress...",
                                            100, 200,
                                            0xC0, 0xC0, 0xC0,
                                            font);
                SdlHardware.ShowHiddenScreen();
                SdlHardware.Pause(2000);
            }
            else if (main.GetChosenOption() == 3)
            {
                ChangeControlsMenu change = new ChangeControlsMenu();
                change.Run();
                SdlHardware.Pause(100);
            }
        } while (main.GetChosenOption() != 4);
        Controls.SaveControls();
    }
Example #29
0
    public void DrawMenu()
    {
        SdlHardware.DrawHiddenImage(Wallpaper, 0, 0);
        SdlHardware.DrawHiddenImage(controls, 30, 100);

        SdlHardware.WriteHiddenText(texts["hp"],
                                    442, 102,
                                    0x00, 0x00, 0x00,
                                    font72);
        SdlHardware.WriteHiddenText(texts["hp"],
                                    440, 100,
                                    0xFF, 0xFF, 0xFF,
                                    font72);

        SdlHardware.WriteHiddenText(texts["mv"],
                                    132, 552,
                                    0x00, 0x00, 0x00,
                                    font28);
        SdlHardware.WriteHiddenText(texts["mv"],
                                    130, 550,
                                    0xFF, 0xFF, 0xFF,
                                    font28);
        SdlHardware.WriteHiddenText(texts["iv"],
                                    512, 552,
                                    0x00, 0x00, 0x00,
                                    font28);
        SdlHardware.WriteHiddenText(texts["iv"],
                                    510, 550,
                                    0xFF, 0xFF, 0xFF,
                                    font28);
        SdlHardware.WriteHiddenText(texts["it"],
                                    872, 552,
                                    0x00, 0x00, 0x00,
                                    font28);
        SdlHardware.WriteHiddenText(texts["it"],
                                    870, 550,
                                    0xFF, 0xFF, 0xFF,
                                    font28);
        SdlHardware.WriteHiddenText(texts["mg"],
                                    322, 652,
                                    0x00, 0x00, 0x00,
                                    font28);
        SdlHardware.WriteHiddenText(texts["mg"],
                                    320, 650,
                                    0xFF, 0xFF, 0xFF,
                                    font28);
    }
Example #30
0
 public static void ShowHelp()
 {
     SdlHardware.ClearScreen();
     SdlHardware.WriteHiddenText("Eat the dots, avoid the ghosts.",
                                 200, 500,
                                 0xCC, 0xCC, 0xCC,
                                 sans18);
     SdlHardware.WriteHiddenText("Hit ESC to return",
                                 300, 540,
                                 0x99, 0x99, 0x99,
                                 sans18);
     SdlHardware.ShowHiddenScreen();
     do
     {
         SdlHardware.Pause(20);
     }while (!SdlHardware.KeyPressed(SdlHardware.KEY_ESC));
 }