Skip to main content
1 of 2
Mangata
  • 2.8k
  • 1
  • 4
  • 10

You can simply put sprite_sheet.get_image into the loop:

self.walk_right = []

for num in range (1,10):
    walk_right_temp = sprite_sheet.get_image(num,11,sprite_width,sprite_height,1.25,0)
    self.walk_right.append(walk_right_temp)

Or use python's list comprehension:

self.walk_right = [sprite_sheet.get_image(num,11,sprite_width,sprite_height,1.25,0) for num in range (1,10)]
Mangata
  • 2.8k
  • 1
  • 4
  • 10