From f457ad06432a980ea42a4f42a98117923fa31a8c Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 20 Apr 2020 02:41:08 -0500 Subject: [PATCH] fix simple whitespace issues --- triple-dungeon/mobs.py | 1 + triple-dungeon/sprites.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/triple-dungeon/mobs.py b/triple-dungeon/mobs.py index a6c3477..741bffe 100644 --- a/triple-dungeon/mobs.py +++ b/triple-dungeon/mobs.py @@ -7,6 +7,7 @@ import arcade from config import Config, Enums + class Mob(arcade.Sprite): """ Represents a Mob. No defined behaviour, it has no intelligence. diff --git a/triple-dungeon/sprites.py b/triple-dungeon/sprites.py index 24c1cc2..ea3301d 100644 --- a/triple-dungeon/sprites.py +++ b/triple-dungeon/sprites.py @@ -37,23 +37,24 @@ class AnimationSet(object): # Finds all matching files matches = [file for file in self.animations if re.match(pattern, file)] # Sort in ascending order based on the connected animation index. Zero-indexing or not does not affect order. - matches.sort(key=lambda match : int(match.group(1))) + matches.sort(key=lambda match: int(match.group(1))) # Grab the filename and load it to the file directory - matches = list(map(lambda match : arcade.load_texture(os.path.join(self.directory, match.group(0))), matches)) + matches = list(map(lambda match: arcade.load_texture(os.path.join(self.directory, match.group(0))), matches)) return cycle(matches) + class PlayerAnimations(AnimationSet): """ A class dedicated to serving player animations. Player animations must be served to the class in the correct format. """ - def __init__(self): + def __init__(self, directory: str): """ Initializes the PlayerAnimations class. """ - super(PlayerAnimations, self).__init__() + super(PlayerAnimations, self).__init__(directory) # Grabs all animations needed. These are infinite iters, use next(iter) to grab the next animation. self.idles = self.getAnimations(re.compile(r'idle_(\d+).png')) @@ -61,5 +62,3 @@ class PlayerAnimations(AnimationSet): self.right = self.getAnimations(re.compile(r'run_right_(\d+).png')) self.up = self.getAnimations(re.compile(r'run_up_(\d+).png')) self.down = self.getAnimations(re.compile(r'run_left_(\d+).png')) - - def __loadAnimations(self): \ No newline at end of file