WMICraft/models/knight.py

16 lines
510 B
Python

import pygame.image
import random
class Knight(pygame.sprite.Sprite):
def __init__(self, img):
super().__init__()
self.images = []
self.image = pygame.image.load("./resources/textures/knight.png")
self.image = pygame.transform.scale(self.image, (40, 40))
self.images.append(self.image)
self.rect = self.image.get_rect()
self.health = random.randrange(7, 12)
self.attack = random.randrange(3, 7)
knights_list = pygame.sprite.Group()