mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-07 03:13:15 -06:00
fix draw path function
This commit is contained in:
@@ -123,13 +123,17 @@ class Game(arcade.Window):
|
|||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
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.
|
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.
|
: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):
|
def on_key_press(self, key, modifiers):
|
||||||
"""Called whenever a key is pressed. """
|
"""Called whenever a key is pressed. """
|
||||||
|
|||||||
@@ -44,9 +44,7 @@ class Mob(arcade.Sprite):
|
|||||||
"""
|
"""
|
||||||
A on_update function, the Mob should decide it's next actions here.
|
A on_update function, the Mob should decide it's next actions here.
|
||||||
"""
|
"""
|
||||||
|
pass
|
||||||
if Config.DEBUG:
|
|
||||||
if self.target is not None:
|
|
||||||
|
|
||||||
def get_path(self, end: Tuple[int, int] = None) -> List[Tuple[int, int]]:
|
def get_path(self, end: Tuple[int, int] = None) -> List[Tuple[int, int]]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user