From a91a0f4a73cc446703b5b513e095c4e948282105 Mon Sep 17 00:00:00 2001 From: Cameron Smart Date: Sun, 26 Apr 2020 00:42:22 -0700 Subject: [PATCH] final touches --- triple-dungeon/README.md | 9 +++++++++ triple-dungeon/map.py | 8 ++++++-- triple-dungeon/resources/levels/box.json | 19 ------------------- .../levels/map1/{center.json => 1.json} | 0 .../levels/{center1.json => map1/2.json} | 4 ++-- triple-dungeon/resources/levels/map1/3.json | 19 +++++++++++++++++++ triple-dungeon/resources/levels/map1/4.json | 18 ++++++++++++++++++ .../levels/map1/{room.json => 5.json} | 12 ++++++------ triple-dungeon/resources/levels/map1/6.json | 18 ++++++++++++++++++ triple-dungeon/resources/levels/map1/7.json | 18 ++++++++++++++++++ triple-dungeon/resources/levels/map1/8.json | 18 ++++++++++++++++++ triple-dungeon/resources/levels/map1/9.json | 18 ++++++++++++++++++ .../resources/levels/map1/room1.json | 19 ------------------- triple-dungeon/resources/levels/test1.json | 19 ------------------- 14 files changed, 132 insertions(+), 67 deletions(-) delete mode 100644 triple-dungeon/resources/levels/box.json rename triple-dungeon/resources/levels/map1/{center.json => 1.json} (100%) rename triple-dungeon/resources/levels/{center1.json => map1/2.json} (85%) create mode 100644 triple-dungeon/resources/levels/map1/3.json create mode 100644 triple-dungeon/resources/levels/map1/4.json rename triple-dungeon/resources/levels/map1/{room.json => 5.json} (52%) create mode 100644 triple-dungeon/resources/levels/map1/6.json create mode 100644 triple-dungeon/resources/levels/map1/7.json create mode 100644 triple-dungeon/resources/levels/map1/8.json create mode 100644 triple-dungeon/resources/levels/map1/9.json delete mode 100644 triple-dungeon/resources/levels/map1/room1.json delete mode 100644 triple-dungeon/resources/levels/test1.json diff --git a/triple-dungeon/README.md b/triple-dungeon/README.md index 8675345..5c83ab0 100644 --- a/triple-dungeon/README.md +++ b/triple-dungeon/README.md @@ -5,3 +5,12 @@ Team Triple Dungeon ## About This repository is Triple Dungeon's submittion for [Python Discord](https://pythondiscord.com/)'s [Game Jam 2020](https://pythondiscord.com/pages/events/game-jam-2020/). + +This game is far from complete. We ran into some serious lag issues half way though the project, but all agreed that it was a good experience. + +## Install +This game can be installed with `pipenv sync` + +## Instructions +Use WASD to move and the mouse to aim and fire. +Use left shift to cycle through different monster combinations and try to shoot the monsters in that order. \ No newline at end of file diff --git a/triple-dungeon/map.py b/triple-dungeon/map.py index 3666364..6c1f779 100644 --- a/triple-dungeon/map.py +++ b/triple-dungeon/map.py @@ -43,8 +43,10 @@ class Dungeon(object): center = "resources/levels/map1/center.json" self.levels = [ - [Level.load_file(x, y, center) for y in range(size)] for x in range(size) + [Level.load_file(x, y) for y in range(size)] for x in range(size) ] + print('--------------------------------------------------') + print(self.levels) self.matrix = [[1 for yy in range(size * 10)] for xx in range(10 * size)] for column in self.levels: for level in column: @@ -125,7 +127,7 @@ class Level: self.wall_list = [] @staticmethod - def load_file(level_x: int, level_y: int, path: str) -> Level: + def load_file(level_x: int, level_y: int) -> Level: """ Builds a Level from a given file path. @@ -135,6 +137,8 @@ class Level: :return: The new generated Level file. """ + path = f'resources/levels/map1/{random.randint(1, 9)}.json' + level = Level(level_x, level_y) with open(path) as file: data = json.load(file) diff --git a/triple-dungeon/resources/levels/box.json b/triple-dungeon/resources/levels/box.json deleted file mode 100644 index 6defcda..0000000 --- a/triple-dungeon/resources/levels/box.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "elements" : { - "w" : "resources/images/tiles/wall_tile.png", - " " : "resources/images/tiles/floor_tile.png", - "e" : "" - }, - "structure" : [ - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"] - ] -} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/center.json b/triple-dungeon/resources/levels/map1/1.json similarity index 100% rename from triple-dungeon/resources/levels/map1/center.json rename to triple-dungeon/resources/levels/map1/1.json diff --git a/triple-dungeon/resources/levels/center1.json b/triple-dungeon/resources/levels/map1/2.json similarity index 85% rename from triple-dungeon/resources/levels/center1.json rename to triple-dungeon/resources/levels/map1/2.json index 0bcd270..09ba175 100644 --- a/triple-dungeon/resources/levels/center1.json +++ b/triple-dungeon/resources/levels/map1/2.json @@ -9,8 +9,8 @@ ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["e", " ", " ", " ", " ", " ", " ", " ", " ", "e"], - ["e", " ", " ", " ", " ", " ", " ", " ", " ", "e"], + ["e", " ", " ", " ", "w", "w", " ", " ", " ", "e"], + ["e", " ", " ", " ", "w", "w", " ", " ", " ", "e"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], diff --git a/triple-dungeon/resources/levels/map1/3.json b/triple-dungeon/resources/levels/map1/3.json new file mode 100644 index 0000000..b171310 --- /dev/null +++ b/triple-dungeon/resources/levels/map1/3.json @@ -0,0 +1,19 @@ +{ + "elements" : { + "w" : "resources/images/tiles/wall_tile.png", + " " : "resources/images/tiles/floor_tile.png", + "e" : "resources/images/tiles/floor_tile.png" + }, + "structure" : [ + ["w", "w", "w", "w", "e", "e", "w", "w", "w", "w"], + ["w", "w", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", "w", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", "w", " ", " ", " ", " ", " ", "w"], + ["e", " ", " ", " ", "w", " ", " ", " ", " ", "e"], + ["e", " ", " ", " ", " ", "w", " ", " ", " ", "e"], + ["w", " ", " ", " ", " ", " ", "w", " ", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", "w", "w", "w", "e", "e", "w", "w", "w", "w"] + ] +} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/4.json b/triple-dungeon/resources/levels/map1/4.json new file mode 100644 index 0000000..c3affd8 --- /dev/null +++ b/triple-dungeon/resources/levels/map1/4.json @@ -0,0 +1,18 @@ +{ + "elements" : { + "w" : "resources/images/tiles/wall_tile.png", + " " : "resources/images/tiles/floor_tile.png" + }, + "structure" : [ + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", "w", "w", " ", " ", "w", "w", " ", "w"], + ["w", " ", "w", "w", " ", " ", "w", "w", " ", "w"], + [" ", " ", " ", " ", " ", " ", " ", " ", " ", " "], + [" ", " ", " ", " ", " ", " ", " ", " ", " ", " "], + ["w", " ", "w", "w", " ", " ", "w", "w", " ", "w"], + ["w", " ", "w", "w", " ", " ", "w", "w", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"] + ] +} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/room.json b/triple-dungeon/resources/levels/map1/5.json similarity index 52% rename from triple-dungeon/resources/levels/map1/room.json rename to triple-dungeon/resources/levels/map1/5.json index b070da4..991e4ae 100644 --- a/triple-dungeon/resources/levels/map1/room.json +++ b/triple-dungeon/resources/levels/map1/5.json @@ -6,13 +6,13 @@ "structure" : [ ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", " ", "w", "w", " ", " ", " ", "w"], + ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], + [" ", " ", " ", " ", " ", " ", "w", " ", " ", "w"], + [" ", " ", " ", "w", " ", " ", "w", " ", " ", "w"], + ["w", " ", " ", " ", "w", "w", " ", " ", " ", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", "w", "w", " ", " ", " ", " "], - ["w", " ", " ", " ", "w", "w", " ", " ", " ", " "], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"] + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"] ] } \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/6.json b/triple-dungeon/resources/levels/map1/6.json new file mode 100644 index 0000000..ee85d6c --- /dev/null +++ b/triple-dungeon/resources/levels/map1/6.json @@ -0,0 +1,18 @@ +{ + "elements" : { + "w" : "resources/images/tiles/wall_tile.png", + " " : "resources/images/tiles/floor_tile.png" + }, + "structure" : [ + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], + [" ", " ", " ", " ", "w", "w", " ", " ", " ", " "], + [" ", " ", " ", " ", "w", "w", " ", " ", " ", " "], + ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"] + ] +} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/7.json b/triple-dungeon/resources/levels/map1/7.json new file mode 100644 index 0000000..5060bc6 --- /dev/null +++ b/triple-dungeon/resources/levels/map1/7.json @@ -0,0 +1,18 @@ +{ + "elements" : { + "w" : "resources/images/tiles/wall_tile.png", + " " : "resources/images/tiles/floor_tile.png" + }, + "structure" : [ + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"], + ["w", " ", " ", "w", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", "w", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", "w", "w", "w", "w", " ", " ", "w"], + [" ", " ", " ", " ", " ", " ", " ", " ", " ", " "], + [" ", " ", " ", " ", " ", " ", " ", " ", " ", " "], + ["w", " ", " ", "w", "w", "w", "w", " ", " ", "w"], + ["w", " ", " ", "w", " ", " ", " ", " ", " ", "w"], + ["w", " ", " ", "w", " ", " ", " ", " ", " ", "w"], + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"] + ] +} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/8.json b/triple-dungeon/resources/levels/map1/8.json new file mode 100644 index 0000000..8ba687e --- /dev/null +++ b/triple-dungeon/resources/levels/map1/8.json @@ -0,0 +1,18 @@ +{ + "elements" : { + "w" : "resources/images/tiles/wall_tile.png", + " " : "resources/images/tiles/floor_tile.png" + }, + "structure" : [ + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", "w", " ", " ", " ", " ", "w", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + [" ", " ", " ", " ", "w", " ", " ", " ", " ", " "], + [" ", " ", " ", " ", " ", "w", " ", " ", " ", " "], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", "w", " ", " ", " ", " ", "w", " ", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"] + ] +} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/9.json b/triple-dungeon/resources/levels/map1/9.json new file mode 100644 index 0000000..c268a10 --- /dev/null +++ b/triple-dungeon/resources/levels/map1/9.json @@ -0,0 +1,18 @@ +{ + "elements" : { + "w" : "resources/images/tiles/wall_tile.png", + " " : "resources/images/tiles/floor_tile.png" + }, + "structure" : [ + ["w", "w", "w", "w", " ", "w", "w", "w", "w", "w"], + ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], + ["w", " ", "w", " ", "w", " ", " ", "w", " ", "w"], + ["w", "w", " ", " ", " ", " ", " ", " ", " ", "w"], + [" ", " ", " ", " ", " ", " ", "w", " ", " ", " "], + [" ", "w", " ", "w", " ", " ", " ", " ", " ", " "], + ["w", " ", " ", " ", " ", "w", " ", "w", " ", "w"], + ["w", " ", " ", " ", "w", " ", " ", " ", " ", "w"], + ["w", " ", "w", " ", " ", " ", "w", " ", " ", "w"], + ["w", "w", "w", "w", " ", " ", "w", "w", "w", "w"] + ] +} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/map1/room1.json b/triple-dungeon/resources/levels/map1/room1.json deleted file mode 100644 index 41559cc..0000000 --- a/triple-dungeon/resources/levels/map1/room1.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "elements" : { - "w" : "resources/images/tiles/wall_tile.png", - " " : "resources/images/tiles/floor_tile.png", - "e" : "resources/images/tiles/floor_tile.png" - }, - "structure" : [ - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["e", " ", " ", " ", "w", "w", " ", " ", " ", "w"], - ["e", " ", " ", " ", "w", "w", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"] - ] -} \ No newline at end of file diff --git a/triple-dungeon/resources/levels/test1.json b/triple-dungeon/resources/levels/test1.json deleted file mode 100644 index 45e3c95..0000000 --- a/triple-dungeon/resources/levels/test1.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "elements" : { - "w" : "resources/images/tiles/wall_tile.png", - " " : "resources/images/tiles/floor_tile.png", - "e" : "" - }, - "structure" : [ - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"], - ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], - ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], - ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", " ", " ", " ", " ", " ", " ", "w"], - ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], - ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], - ["w", " ", " ", "w", " ", " ", "w", " ", " ", "w"], - ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w"] - ] -} \ No newline at end of file