juniper-wright / UtopianEngine

The Simple Text Adventure Game Engine
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

How to arrange the run() mechanism? #42

Closed juniper-wright closed 11 years ago

juniper-wright commented 11 years ago

The v1 mechanism works something like this:

do-while loop that wants _endgame to be... any... value? Inside of that do-while is a while(true). Inside of that while(true) is a WHOLE bunch of crap that gets them into the main game loop. This is atrocious.

Proposed v2 mechanism:

try
{
    load the "Menu" game via XML.
    while(true)
    {
        get player input.
        check for keys.
        If a key is found, run the events.
    }
}
catch(GameEndException e)
{
    Not sure what goes here yet. Maybe print out e.getmessage()?
}
juniper-wright commented 11 years ago

The proposed mechanism has been approved, and implemented as of 0f33f5a87566f5cbe9c79ba71a929d17922cb931.