samples/06_save_load/01_save_load_game/app/main.rb
def load
    parsed_state = $gtk.deserialize_state('game_state.txt')
    if !parsed_state
      set_story_line "no game to load. press save first."
    else
      $gtk.args.state = parsed_state
    end
  end
# Loads the game state from the game_state.txt text file.
# If the load is unsuccessful, the user is informed since the story line indicates the failure.
Loads the game state from the game_state.txt text file.
If the load is unsuccessful, the user is informed since the story line indicates the failure.
Loads the game state from the game_state . txt text file . If the load is unsuccessful the user is informed since the story line indicates the failure .
def load
    parsed_state = $gtk.deserialize_state('game_state.txt')
    if !parsed_state
      set_story_line "no game to load. press save first."
    else
      $gtk.args.state = parsed_state
    end
  end
def load parsed_state = $gtk . deserialize_state ( 'game_state.txt' ) if ! parsed_state set_story_line "no game to load. press save first." else $gtk . args . state = parsed_state end end
Loads the game state from the game_state.txt text file.
Loads the game state from the game_state . txt text file .