Skip to content

Instantly share code, notes, and snippets.

@yukas
Created October 5, 2016 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukas/6eec3ec270d73a47e0fedca1530abb18 to your computer and use it in GitHub Desktop.
Save yukas/6eec3ec270d73a47e0fedca1530abb18 to your computer and use it in GitHub Desktop.
class Game
def save_player_state
File.open('path/to/config.cfg', 'a') do |f|
f.write('player_state: near_window')
end
end
end
class Player
def read_state
@state = IO.read('path/to/config.cfg')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment