mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-09 08:05:20 -06:00
fix simple whitespace issues
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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):
|
||||
Reference in New Issue
Block a user