Skip to content

Showdown in Ghost Town

Showdown in Ghost Town was my first C++ commercial game. It used DirectX 6. I ported the engine over to Windows CE and Dreamcast just for fun. These are simple games for children with lots of animation and things to click on. The player’s goal is to solve a mystery by finding and gathering clues. I rewrote the base engine and game framework to be C++ instead of C. I also rewrote all the tools in MFC.

These Scooby-Doo projects really pushed my knowledge of game programming and OOP. I studied design patterns and purposefully worked on improving my code style. I found that I enjoyed writing tools as much as I liked writing games. The two programmers on the team, me and another guy, split the work up where he did most of the game logic and I did the engine and tools. We taught each other a lot. Later on he became the lead at Midway Games on Stranglehold where I worked with him an additional three years.

Example of one of the tools, Sound Manager:

External Links:

void CGBH_Game::AddClue(const CString & name)
{
    if ( IsClueFound(name) )
        return;

    UL        index = 0;
    CString   clue;
    UL        difficulty = GetDifficulty();

    while ( index < MAX_CLUES )
    {
        if ( m_Clues_Found[index].IsEmpty() )
        {
            bool found = true;

            if ( name == m_Whodunit )
            {
                while ( found == true )
                {
                    clue = GenerateRedHerring(name);
                    found = false;

                    for ( UL i = 0 ; i < MAX_CLUES ; i++ )
                        if ( m_Clues_Found[i] == clue )
                        {
                            found = true;
                            break;
                        }

                    if ( found == false )
                    {
                        m_Clues_Found[index] = clue;
                        m_Clue_Owners[index] = name;

                        m_Clues_Prompt = true; //suspects and clues will give an audio prompt next time

                        break;
                    }
                }
            }
            else
            {
                while ( found == true )
                {
                    UL random = (rand() % 2) + 3;

                    if ( m_Whodunit == "ARTIE" )
                    {
                        if ( IsRequiredClueFound(Artie_Clues[0]) == false ||
                             IsRequiredClueFound(Artie_Clues[1]) == false ||
                             IsRequiredClueFound(Artie_Clues[2]) == false )
                            clue = Artie_Clues[rand() % 3];
                        else if ( difficulty > 0 )
                            clue = GenerateRedHerring(name);
                        else
                            clue = Artie_Clues[random];
                    }
                    else if ( m_Whodunit == "GUMMY" )
                    {
                        if ( IsRequiredClueFound(Gummy_Clues[0]) == false ||
                             IsRequiredClueFound(Gummy_Clues[1]) == false ||
                             IsRequiredClueFound(Gummy_Clues[2]) == false )
                            clue = Gummy_Clues[rand() % 3];
                        else if ( difficulty > 0 )
                            clue = GenerateRedHerring(name);
                        else
                            clue = Gummy_Clues[random];
                    }
                    else if ( m_Whodunit == "SHERIFF" )
                    {
                        if ( IsRequiredClueFound(Sheriff_Clues[0]) == false ||
                             IsRequiredClueFound(Sheriff_Clues[1]) == false ||
                             IsRequiredClueFound(Sheriff_Clues[2]) == false )
                            clue = Sheriff_Clues[rand() % 3];
                        else if ( difficulty > 0 )
                            clue = GenerateRedHerring(name);
                        else
                            clue = Sheriff_Clues[random];
                    }
                    else if ( m_Whodunit == "JENNY" )
                    {
                        if ( IsRequiredClueFound(Jenny_Clues[0]) == false ||
                             IsRequiredClueFound(Jenny_Clues[1]) == false ||
                             IsRequiredClueFound(Jenny_Clues[2]) == false )
                            clue = Jenny_Clues[rand() % 3];
                        else if ( difficulty > 0 )
                            clue = GenerateRedHerring(name);
                        else
                            clue = Jenny_Clues[random];
                    }
                    else if ( m_Whodunit == "ICDOUBLE" )
                    {
                        if ( IsRequiredClueFound(IC_Double_Clues[0]) == false ||
                             IsRequiredClueFound(IC_Double_Clues[1]) == false ||
                             IsRequiredClueFound(IC_Double_Clues[2]) == false )
                            clue = IC_Double_Clues[rand() % 3];
                        else if ( difficulty > 0 )
                            clue = GenerateRedHerring(name);
                        else
                            clue = IC_Double_Clues[random];
                    }
                    
                    found = false;

                    for ( UL i = 0 ; i < MAX_CLUES ; i++ )
                        if ( m_Clues_Found[i] == clue )
                        {
                            found = true;
                            break;
                        }

                    if ( found == false )
                    {
                        m_Clues_Found[index] = clue;
                        m_Clue_Owners[index] = name;

                        m_Clues_Prompt = true; //suspects and clues will give an audio prompt next time

                        break;
                    }
                }
            }

            break;
        }
        index++;
    }
}