Game Menu and pause menu

Hello Guys, how manager the menu screen on pause game ?
I have:

New Game -> Start new game (ok)
Options -> options screen (ok)
Quit -> ok

but how I make the pause screen??
when i push “ESC” work, but the scene still running, like ParticleEmitter and physics.

Thanks

AppStates

Ok…
But the previous screen continues in running…
how i pause the previous screen ?
… and cancel/dont manager input of the previous screen ?

Not an answer to all your questions, but concerning the keys:

  • have your playGame appState have a playGameListener.

  • when playGame appState is enabled, it should enable the playGame keys (have the listener class do that)

  • when playGame appState is disabled, it should disable the playGame keys

  • have a pause appState with a pauseGameListener

  • when pause appState is enabled, it should enable the stop pause key

  • when playGame appState is disabled, it should disable the stop pause key

When you want to pause:

  • you disable playGame appState
  • you enable pause appState

When you want to return to playing the game:

  • you disable the pause appState
  • you enable the playGame appState

The idea is to have the app states take care of their keys, visuals (nifty etc), etc.

i found this https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:appstatesdemo… work, but have bug…
the screens dont “clear”

@sradkiller said: i found this https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:appstatesdemo... work, but have bug... the screens dont "clear"

It also overrides stateAttached and stateDetached… this is something you should normally NEVER do. That demo is really pretty broken.

I’ve added a note at the top of the demo.

Now i understand,
because my english is bad :frowning:
Sorry.
I Will test and post result.

Thank guys :slight_smile:
This Link solve :slight_smile:
and now… how i enable inputmanager key just in determined AbstractAppState ?
Sample:

The keys W, A,D,S just works in MyAbstractAppState1
The keys I, O, K, J just works in MyAbstractAppState2

??

Thank :slight_smile:

@zarch said: I've added a note at the top of the demo.

Heheh… yours is much more noticeable than the one I added last week. Mine is lower down in the text… I guess proving that no one reads the text. :slight_smile:

Yep, we now have it in yellow, in title and in main text - so hopefully people should see at least one of them now :slight_smile:

hehehehe, my problem was because of the English.
I’m Brazilian :slight_smile:
Thank guys

@sradkiller said: Thank guys :) This Link solve :) and now... how i enable inputmanager key just in determined AbstractAppState ? Sample:

The keys W, A,D,S just works in MyAbstractAppState1
The keys I, O, K, J just works in MyAbstractAppState2

??

Thank :slight_smile:

When an appState is enabled, it should, for each key:

  • inputManager.addMapping(…
  • inputManager.addListener(…
    When disabled, it should, for each key:
  • inputManager.deleteMapping(…

Ideally, have a method do that in a listener class, one per appState and have the appState call that method when it is enabled/disabled (like I described up there)

Ok guy, i understand :slight_smile:
Is new keys to each appstate :slight_smile:

Thank you