Exemplo n.º 1
0
    void UpdateScreen()
    {
        SdlHardware.ClearScreen();
        board.DrawOnHiddenScreen();
        dice.DrawOnHiddenScreen();

        SdlHardware.WriteHiddenText("Press H for Help",
                                    40, 5,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        SdlHardware.WriteHiddenText("Press Q to Finish",
                                    690, 5,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        if (!failedAnswer)
        {
            SdlHardware.WriteHiddenText(players[actualPlayer],
                                        420, 140,
                                        0xCC, 0xCC, 0xCC,
                                        font18);
        }

        if (questionList.GetError())
        {
            SdlHardware.WriteHiddenText("File error",
                                        350, 350,
                                        0xFF, 0x00, 0x00,
                                        font30);
        }

        if (canShowQuestion)
        {
            ShowQuestion();
        }

        if (failedAnswer)
        {
            SdlHardware.WriteHiddenText("Wrong answer",
                                        330, 350,
                                        0xFF, 0x00, 0x00,
                                        font30);
            SdlHardware.WriteHiddenText(
                "Next player " + players[actualPlayer],
                330, 390,
                0xCC, 0xCC, 0xCC,
                font18);
            SdlHardware.WriteHiddenText(
                "Press SPC to continue",
                330, 470,
                0x8a, 0x2b, 0xe2,
                font18);
        }

        if (successfulAnswer)
        {
            SdlHardware.WriteHiddenText("Correct answer",
                                        310, 350,
                                        0xFF, 0x00, 0x00,
                                        font30);

            if (actualPlayer == 0)
            {
                SdlHardware.WriteHiddenText(
                    "You can throw the dice again",
                    280, 390,
                    0xCC, 0xCC, 0xCC,
                    font18);
            }
            else if (actualPlayer == 1)
            {
                SdlHardware.WriteHiddenText(
                    "Press SPC to continue",
                    300, 470,
                    0x8a, 0x2b, 0xe2,
                    font18);
            }
        }

        SdlHardware.WriteHiddenText("D to Throw the Dice",
                                    340, 610,
                                    0xCC, 0xCC, 0xCC,
                                    font18);

        SdlHardware.ShowHiddenScreen();
    }