Wow, you really don't understand loops, do you?
Look.
while (true) {
QueuePersonCommand(...);
}
The above is doing work. It'll be queuing forever! It is executing the code. There is nothing wrong. It's just doing it forever.
Look.
function Interface_Update() //<--grabs input
{
while (AreKeysLeft()) {
if (GetKey() == KEY_SPACE) { //<--Space Key acts as the Select Button
select += select_direct;
if (select == 1) select_direct *= -1;
if (select == 4) select_direct *= -1;
return select;
}
}
AreKeysLeft() is only true when you press keys. So the while loop only executes when you press keys, allowing for other events to happen.
Look.
while (true) {
QueuePersonCommand(...);
UpdateMapEngine();
RenderMap();
FlipScreen();
}
Will not block anything. But this doesn't stop the fact you are looping the queue forever. A loop is a loop is a loop. It doesn't execute after it is finished, no, it's executing all the time. You just won't notice it until you either break out of the loop or manually run your own update or render logic.
Here's a brain-dead simple loop.
var i = 0;
while (true) {
i++;
if (i == 5) break;
}
What is the value of i when the loop breaks? 0 or 5? It's 5. So therefore things are being executed during the loop. Now, will you ever see the value increment to 5? No! Gosh, it's hard to explain but video games are not mindless loops, they have graphics to display and other such things. Let's try this out.
var i = 0;
var font = GetSystemFont();
while (true) {
i++;
if (i == 5) break;
else {
font.drawText(0, 0, i);
FlipScreen();
GetKey();
}
}
Now what happens here is that GetKey() itself is blocking code too, but now at least you can see the damn number update. This is the illusion of control. You need to show this in your own loops in order for them to look like they are doing work. Otherwise there is nothing wrong with your loops - they just seemingly go on forever, as loops should!