How are people implementing "pause" menus?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Damm i deleted an esential function lol.
when u look at my code i only explain the gui clearing for the game but i'm using a second scene manager for the menu as well and u can pause each one individualy and it will be stored in memory for fast access.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Dark Rain
Posts: 47
Joined: Thu Jul 07, 2005 1:31 am

Post by Dark Rain »

Using a state machine doesn't involve saving all the variable and restoring them each time you change the state of the machine. A state machine is all about easily handling different behavior on say some data easily. It's used a lot in interfaces and AI's in games.
Quall.

Post by Quall. »

I just created a state manager, simular to that on the previus page. However, I use pointers.

I have an abstract class a bunch derived from it. The class's have a "play", "pause", and "update" method.

I then have 2 pointers...lastState and currentState.
Whenever I change states..

Code: Select all

changestate(State *t)
lastState=currentState;
currentState = t;
lastState->pause(); // pause the last state
currentState->update(); //update the scene to the screen before you unpause it.
currentState->play(); //play this state
Quall
Posts: 154
Joined: Mon Mar 07, 2005 10:16 pm

Post by Quall »

btw, pause() stops the timer, so only 1 scene animated by the timer would work at a time.

and the above code should be enclosed as a method.
Post Reply