"Play again or exit game?"

Imagine a single-player game in which you play for a certain predefined time. After time is up, you get the chance to choose either to play the game once more or simply exit the game.

What is the preferred/best way to give the player this choice in JME3?

If you were playing the game, what would you want?
The answer might depend on the environment the game is running in.

I’d probably want a screen or modal dialog box with two buttons (and appropriate keyboard shortcuts) but I’m very desktop-oriented.

Simplest option? Close the game and the choice to keep playing is to run it again :stuck_out_tongue:

Joking aside, sounds like you need a gui. There are a few ways to go about it, but I’d suggest the Lemur library myself.

I watch a video game reviewer called “Zero Punctuation” that’s on the Escapist YouTube channel. He had 1 rather interesting complaint about a game that would require playing again and again.

The more steps you add or the more of a delay you add between dying and playing again the more annoying it is.

Take that as you will. Good luck!

In case it matters, information about Lemur (since it was mentioned):

For setup and simple dialogs, this example might be helpful:

…you just probably need to skip over the network related stuff.

And it occurs to me that once you’ve done basic setup, you can attach the OptionPanelState and just use an option pop-up.

Something like this (from the above example):

Thank you very much! This is good advice.

I am experimenting with having two AppStates (that is, two classes extending BaseAppState), one for the game and one for asking for a re-play, and shifting between the two. Seems to be working fine. But I’m grateful for your suggestion.