How to break out of loop?

The main function looks something like this

1
2
3
4
5
6
7
8
9
10
11
12
while(blahalhha)
{
	while(blahalhal)
	{
		if(blahlahlahla)
		{
			User.handleEvents();
			Computer.handleEvents();
		}
	}
}


When the program gets to User.HandleEvents(); is stays there. I want to be able to go to User.HandleEvents();, do one event, then go back to main and do one event from Computer.handleEvents(); then loop it so they take turns. Any help?
Change it to this:
1
2
User.handleEvent();
Computer.handleEvent();

As the name implies, those functions would handle at most one event per call.
I dont think changing the name will fix it >_<
Of course it does, assuming the functions do the right thing.
If you want to handle a single event, then handle just a single event. Entering a permanent event loop won't do it in that case, will it?
Last edited on
How do i handle a single event? its like it sits there waiting.
Never mind i got it without your help >:p
Topic archived. No new replies allowed.