Create a game settings tab in the settings view and add a difficulty … #5655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…slider to it
Difficulty is stored 2 ways, once for the Engine as a config value that will apply to any new game you start.
A game itself (so a savefile) will persist it's own difficulty and if it's not available on load, will use the engine configured value.
Within lua code the
Game.difficulty
attribute can be used to determine the current difficulty level, from 0 to 1, easiest to hardest.Also, separate out settings persistence from closing the window, so now if you open the settings window, change the settings and then save the game they are persisted in the saved game state.
Note: This currently has no effect at all on the way the game plays, this will come later, however, I believe there is enough here to have a good conversation on the direction this is taking.