fix draw path function

This commit is contained in:
Xevion
2020-04-21 14:09:56 -05:00
parent b65d12be16
commit 7948662459
2 changed files with 8 additions and 6 deletions

View File

@@ -123,13 +123,17 @@ class Game(arcade.Window):
import traceback
traceback.print_exc()
def draw_path(self, path: List[Tuple[int, int]]) -> None:
@staticmethod
def draw_path(path: List[Tuple[int, int]]) -> None:
"""
Draws a line between positions in a list of tuple, also known as the path.
:param path: A list of tuple positions defining a path that can be traversed.
"""
print(path)
pass
if len(path) > 2:
path = map(lambda point: ((0.5 + point[0]) * Config.TILE_SIZE, (0.5 + point[1]) * Config.TILE_SIZE), path)
arcade.draw_lines(list(path))
# for pos1, pos2 in zip(path, path[1:])
def on_key_press(self, key, modifiers):
"""Called whenever a key is pressed. """

View File

@@ -44,9 +44,7 @@ class Mob(arcade.Sprite):
"""
A on_update function, the Mob should decide it's next actions here.
"""
if Config.DEBUG:
if self.target is not None:
pass
def get_path(self, end: Tuple[int, int] = None) -> List[Tuple[int, int]]:
"""