diff --git a/.gitignore b/.gitignore index b4eeb9d..b31c693 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Custom Ignores +data/saved + # Pycharm IDE .idea diff --git a/README.md b/README.md index 91c1ebd..5a1f2a5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ Conqueror of Empires is a turn-based strategy game where up to 4 local players b The game was inspired by [Polytopia](http://midjiwan.com/polytopia.html) and [Civilisation](https://civilization.com/) and made using python and pygame. To download executables see [releases](https://github.com/Ben-Ryder/Conqueror-of-Empires/releases). +*** +**v1.0.1**: Release version 1.0.1 brings a proper fix for game crashes where the `saved` directory doesn't exist. +*** + ## Playing the Game #### From Source: Run the `main.py` file from the repository root. diff --git a/data/saved/.gitignore b/data/saved/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/data/saved/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/project/game/new.py b/project/game/new.py index 0852a62..8a5b6a2 100644 --- a/project/game/new.py +++ b/project/game/new.py @@ -1,5 +1,7 @@ # Ben-Ryder 2019 +import os + import project.game.model as model import project.data as data import paths @@ -8,4 +10,9 @@ def make(game_name, map_name, players): """ where players = [[name, colour], [name,colour]...]""" game = model.Model(game_name, map_name, players) # creates "blank" game + + # Creating 'saved' directory if it doesn't exist. + if not os.path.exists(paths.gamePath): + os.mkdir(paths.gamePath) + data.save(game, paths.gamePath + game_name)