def loadSprites(self): spritesAmount = countFiles(g.dataPath + '/items/') for i in range(spritesAmount): tempImage = pygame.image.load(g.dataPath + '/items/' + str(i) + '.png').convert_alpha() self.itemSprites.append(tempImage) spritesAmount = countFiles(g.dataPath + '/spells/') for i in range(spritesAmount): tempImage = pygame.image.load(g.dataPath + '/spells/' + str(i) + '.bmp').convert() self.spellSprites.append(tempImage)
def loadSprites(self): # count how many sprites there are spriteAmount = countFiles(g.dataPath + '/sprites/') # load them all for i in range(0, spriteAmount): tempImage = pygame.image.load(g.dataPath + "/sprites/" + str(i) + ".bmp").convert() tempImage.set_colorkey((0, 0, 0)) self.sprites.append(tempImage) # count how many sprites there are itemAmount = countFiles(g.dataPath + '/items/') # load them all for i in range(0, itemAmount): tempImage = pygame.image.load(g.dataPath + "/items/" + str(i) + ".png").convert_alpha() self.itemSprites.append(tempImage)