Skip to content

Commit 82ed3fe

Browse files
committed
final
1 parent c043299 commit 82ed3fe

File tree

9 files changed

+2
-516
lines changed

9 files changed

+2
-516
lines changed

character.py

Lines changed: 0 additions & 105 deletions
This file was deleted.

game.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from map import GameMap
55
from path import Path
66
import os
7-
import pandas as pd
87

98

109
class Game:
@@ -84,7 +83,3 @@ def write(self) -> None:
8483
game_map.write_map()
8584
for path in self.path_list:
8685
path.write_path()
87-
88-
89-
90-

interface.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
import menu
1010
from path import Path
1111
from player import Player
12-
from map import GameMap
13-
import os
1412
import copy
15-
import time
1613

1714

1815
class GameDisplay:
@@ -479,32 +476,3 @@ def next_pos(cur_pos: Tuple[int, int], move: str, h_step, v_step) -> Tuple[int,
479476
'down': (cur_pos[0], cur_pos[1] + v_step)}
480477

481478
return possible_next_pos[move]
482-
483-
484-
def run():
485-
"""Runs the game"""
486-
# Initializes player
487-
ply = Player('Test')
488-
489-
# New GameMap object with generated game objects
490-
map1 = GameMap((800, 800), 40, True)
491-
# Save map to file
492-
map1.write_map()
493-
494-
# Retrieve the name of the map that was just saved
495-
map_num = len([m for m in os.listdir('maps/')])
496-
map_name = 'map{}.csv'.format(map_num)
497-
map_path = os.path.join(r'maps\\', map_name)
498-
# New GameMap object without any game objects: autogen = False
499-
map2 = GameMap((800, 800), 40, False)
500-
# Reads from the map that was just saved
501-
map2.read_map(map_path)
502-
503-
# Assign map and player to the Path
504-
p = Path((int(20 - 8 / 2), int(400 - 8 / 2)), 1, '1')
505-
# Initializes game
506-
game = Game()
507-
508-
# Initializes Game Display
509-
display = GameDisplay((800, 800))
510-
display.run_game(game)

main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
"""
44
from interface import GameDisplay
55
from game import Game
6-
from player import Player
7-
from path import Path
86

97

108
if __name__ == "__main__":

menu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pygame as pg
33
from pygame.locals import *
44
import pygame_gui as pg_gui
5-
from typing import Tuple, List, Any, Dict
5+
from typing import Tuple, List, Dict
66
from pygame_gui.core import IncrementalThreadedResourceLoader
77

88

@@ -359,4 +359,3 @@ def display(self, on) -> str:
359359

360360
def reset(self):
361361
self.return_option = ''
362-

path.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ def shortest_path(self, pos1: Tuple[int, int], pos2: Tuple[int, int]) -> List[Tu
207207
return path_gen
208208
visited.append(vertex)
209209

210-
211210
def write_path(self) -> None:
212211
"""Saves relevant information for the current path to file"""
213212
# Returns number of existing paths from directory
@@ -233,7 +232,6 @@ def write_path(self) -> None:
233232
# Saves map file to directory
234233
object_info.to_csv(os.path.join(r'paths\\', path_name), index=False)
235234

236-
237235
def read_path(self, path_file: str) -> None:
238236
"""Reads a path from file, retrieving all relevant information required
239237
to rebuild a path"""

player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Player:
99
1010
Attributes
1111
----------
12-
user_id : string
12+
player_id : string
1313
Represents the user id of the player.
1414
This can be used to identify different players on the interface.
1515
backpack : dict

0 commit comments

Comments
 (0)