I implemented a simple save game feature, requested in #73. Instead of using JSON, I chose YAML, since it is easier to serialize ruby objects, and it is human-readable as well.
As for the load_game function, it catches an exception in case the save file doesn't exist or if it has a YAML syntax error and returns nil, but I think it could be severely improved.
I implemented a simple save game feature, requested in #73. Instead of using JSON, I chose YAML, since it is easier to serialize ruby objects, and it is human-readable as well.
As for the
load_game
function, it catches an exception in case the save file doesn't exist or if it has a YAML syntax error and returns nil, but I think it could be severely improved.Let me know if I did anything wrong.