Exemplo n.º 1
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.º 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 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.º 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);
    }
Exemplo n.º 5
0
 void UpdateScreen()
 {
     SdlHardware.ClearScreen();
     room.DrawOnHiddenScreen();
     player.DrawOnHiddenScreen();
     SdlHardware.ShowHiddenScreen();
 }
Exemplo n.º 6
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.º 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);
    }
Exemplo n.º 8
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.º 9
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.º 10
0
 public void UpdateScreen()
 {
     SdlHardware.ClearScreen();
     DrawMenu();
     ShowHistory();
     SdlHardware.ShowHiddenScreen();
 }
Exemplo n.º 11
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.º 12
0
    public void Run()
    {
        SdlHardware.ClearScreen();
        SdlHardware.DrawHiddenImage(loginImage, 340, 300);
        SdlHardware.ShowHiddenScreen();

        SdlHardware.Pause(3000);
    }
Exemplo n.º 13
0
 public override void DibujarInterfaz()
 {
     SdlHardware.ClearScreen();
     SdlHardware.DrawHiddenImage(bg, 0, 0);
     DibujarInterfazSalvaje();
     DibujarInterfazSeleccionado();
     SdlHardware.DrawHiddenImage(fondo_opciones, 0, 534);
 }
Exemplo n.º 14
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);
    }
Exemplo n.º 15
0
    void UpdateScreen()
    {
        SdlHardware.ClearScreen();
        Groom.DrawOnHiddenScreen();

        Mcharacter.DrawOnHiddenScreen();

        SdlHardware.ShowHiddenScreen();
    }
Exemplo n.º 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;
            }
        }
    }
Exemplo n.º 17
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);
    }
Exemplo n.º 18
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);
    }
Exemplo n.º 19
0
    public void Run()
    {
        SdlHardware.Pause(1000);

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

        SdlHardware.Pause(2000);
    }
Exemplo n.º 20
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);
 }
Exemplo n.º 21
0
 public int Run()
 {
     option = 0;
     LoadText(Oneiric.Languages[Oneiric.Language], "loadSaveMenu");
     SdlHardware.Pause(100);
     do
     {
         SdlHardware.ClearScreen();
         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))
         {
             string nameFile = "data/savedGames/" + (option + 1) +
                               "_game.save";
             if (option == YCURSOR_MAX)
             {
                 return(1);
             }
             else
             {
                 if (!File.Exists(nameFile))
                 {
                     Oneiric.SaveLog("Can't load the game. File Not Found " +
                                     nameFile);
                 }
                 else
                 {
                     Oneiric.LoadGame(nameFile);
                     return(0);
                 }
             }
         }
         SdlHardware.Pause(100);
     }while (true);
     //The loop ends when an option is choosed.
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 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;
        }
    }
Exemplo n.º 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();
 }
Exemplo n.º 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);
    }
Exemplo n.º 27
0
    public int Run()
    {
        option = 0;
        LoadText(Oneiric.Languages[Oneiric.Language], "optionMenu");

        SdlHardware.Pause(100);
        do
        {
            SdlHardware.ClearScreen();
            DrawMenu(Oneiric.Languages[Oneiric.Language],
                     Oneiric.Difficultation[Oneiric.Difficulty]);
            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))
            {
                if (option == YCURSOR_MAX)
                {
                    Oneiric.LoadItemsName();
                    return(option);
                }
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_A))
            {
                ChangeOptions(-1, Oneiric.Languages.Length - 1,
                              Oneiric.Difficultation.Length - 1);
            }
            else if (SdlHardware.KeyPressed(SdlHardware.KEY_D))
            {
                ChangeOptions(1, Oneiric.Languages.Length - 1,
                              Oneiric.Difficultation.Length - 1);
            }
            SdlHardware.Pause(100);
        }while (true);
        //The loop ends when an option is choosed.
    }
Exemplo n.º 28
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();
    }
Exemplo n.º 29
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();
    }
Exemplo n.º 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));
 }