Skip to content

Commit

Permalink
Merge pull request #26 from Ben-Ryder/develop
Browse files Browse the repository at this point in the history
v1.1.1 - Fixing select list and archer icon bugs.
  • Loading branch information
ben-ryder authored Sep 13, 2021
2 parents 2d6e7ca + fb8f137 commit b13d3cd
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ 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.1**: Release version 1.1 changes the data save format to JSON.
***

## Playing the Game
#### From Source:
Run the `main.py` file from the repository root.
Expand All @@ -18,14 +14,15 @@ Run the `main.exe` file from the application folder.

**Linux (Ubuntu/Debian)**
Run the `main` file from the application folder.
*Note: You may have to change the persmissions of the file to allow it to run as a program. See [here](https://askubuntu.com/questions/503558/i-cant-run-application-x-executable-files-in-ubuntu-14-04)*.

*Note: You may have to change the permissions of the file to allow it to run as a program. See [here](https://askubuntu.com/questions/503558/i-cant-run-application-x-executable-files-in-ubuntu-14-04)*.

## Dependencies
_(For source)_
- Python (made with 3.6.5)
- pygame (made with 1.9.4)
_Although it should work with all python 3 versions, and pygame versions. It just hasn't been tested with them._
If running from source then dependencies can be installed from the `requirements.txt` file.

## Contributions
All contributions are welcome. Feel free to raise an issue, suggest new features or even PR something back if you want.

_**Ben Ryder 2019**_
## Screenshots
![Unit Interactions](docs/screenshots/COE-Unit-Interactions.png)
![Spawn Menu](docs/screenshots/COE-Spawn-Menu.png)
![City Level Up](docs/screenshots/COE-City-Level-Up.png)
Binary file modified assets/images/game/archericon-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version = subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE).stdout.decode("utf-8")
assert version != ""
except Exception: # seems to be so dependent on system and versions, easier to do a catch all
version = "v1.1" # git not installed, or older lib version, so revert to hardcoded version
version = "v1.1.1" # git not installed, or older lib version, so revert to hardcoded version


# configuration for pygame.display
Expand Down
Binary file added docs/screenshots/COE-City-Level-Up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/COE-Spawn-Menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/COE-Unit-Interactions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion project/menus/loadgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ def remove_file_extension(filename):
return filename.split(".")[0]


def get_game_files():
valid_game_files = []
folder_items = [file for file in os.listdir(paths.gamePath)]

for folder_item in folder_items:
if os.path.isfile(os.path.join(paths.gamePath, folder_item)) and folder_item.lower().endswith(".json"):
valid_game_files.append(folder_item)

return valid_game_files


class FileSelector:
""" Responsible for the list of files seen on screen """
def __init__(self, control, origin):
Expand All @@ -130,7 +141,7 @@ def __init__(self, control, origin):
os.makedirs(paths.gamePath, exist_ok=True)

# Load Game Names From Directory
self.games = sorted([remove_file_extension(file) for file in os.listdir(paths.gamePath)])
self.games = sorted([remove_file_extension(file) for file in get_game_files()])
try:
self.games.remove(".gitignore") # .gitignore present to stop data being pushed/pulled but still in directory.
except ValueError:
Expand Down

0 comments on commit b13d3cd

Please sign in to comment.