prepend directory
This commit is contained in:
parent
df5acb0e91
commit
f2de153016
|
@ -1,5 +1,5 @@
|
|||
from os import listdir
|
||||
from os.path import isfile
|
||||
from os.path import isfile, join
|
||||
|
||||
from pygame import Color, Rect
|
||||
from pygame.image import load
|
||||
|
@ -26,7 +26,7 @@ class Sprite(Animation):
|
|||
if isfile(path):
|
||||
paths = [path]
|
||||
else:
|
||||
paths = sorted(listdir(path))
|
||||
paths = [join(path, name) for name in sorted(listdir(path))]
|
||||
for path in paths:
|
||||
self.add_frame(load(path), transparency)
|
||||
|
||||
|
|
Loading…
Reference in New Issue