How to programm difficulty in game

I want to know how i can programm a difficulty level in game choosable in the game menu

  • Use a widget (or widgets) to create your menu.
  • Bind menu buttons to functions that set a value somewhere shareable (like in your game state)
  • Have your difficulty logic read the variable from your game state and behave differently depending on the value of the variable.