diff --git a/logic/game.py b/logic/game.py index 11e6f3c..bee0c6c 100644 --- a/logic/game.py +++ b/logic/game.py @@ -87,6 +87,7 @@ class Game: stats = Stats() logs = Logs() + knights_sprite_group = pygame.sprite.Group() monsters_sprite_group = pygame.sprite.Group() castle_sprite_group = pygame.sprite.Group() diff --git a/models/knight.py b/models/knight.py index 31f93cc..8a1da2a 100644 --- a/models/knight.py +++ b/models/knight.py @@ -9,7 +9,10 @@ class Knight(pygame.sprite.Sprite): 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) + + self.health = random.randint(7, 12) + self.attack = random.randint(4, 7) + self.defense = random.randint(1,4) + self.points = 1 knights_list = pygame.sprite.Group() diff --git a/models/monster.py b/models/monster.py index e0363b4..bec0315 100644 --- a/models/monster.py +++ b/models/monster.py @@ -3,15 +3,45 @@ import random class Monster(pygame.sprite.Sprite): - images = [] + monster_images = [] def __init__(self): super().__init__() - self.image = pygame.image.load("./resources/textures/dragon2.png") - self.image = pygame.transform.scale(self.image, (40, 40)) - self.images.append(self.image) + self.monster_image1 = pygame.image.load("./resources/textures/dragon2.png") + self.monster_image1 = pygame.transform.scale(self.monster_image1, (40, 40)) + self.monster_image2 = pygame.image.load("./resources/textures/birb.png") + self.monster_image2 = pygame.transform.scale(self.monster_image2, (40, 40)) + self.monster_image3 = pygame.image.load("./resources/textures/wolfart.png") + self.monster_image3 = pygame.transform.scale(self.monster_image3, (40, 40)) + self.monster_image4 = pygame.image.load("./resources/textures/goblin.png") + self.monster_image4 = pygame.transform.scale(self.monster_image4, (40, 40)) + self.monster_images.append(self.monster_image1) + self.monster_images.append(self.monster_image2) + self.monster_images.append(self.monster_image3) + self.monster_images.append(self.monster_image4) + #self.images.append(self.image1) + self.image = random.choice(self.monster_images) self.rect = self.image.get_rect() monster_list = pygame.sprite.Group() + + self.health = random.randrange(15, 25) self.attack = random.randrange(2, 10) + if self.image == self.monster_images[0]: + self.health = 20 + self.attack = 9 + self.points = 10 + elif self.image == self.monster_images[1]: + self.health = 15 + self.attack = 7 + self.points = 7 + elif self.image == self.monster_images[2]: + self.health = 10 + self.attack = 4 + self.points = 4 + elif self.image == self.monster_images[3]: + self.health = 7 + self.attack = 2 + self.points = 2 + diff --git a/resources/textures/birb.png b/resources/textures/birb.png new file mode 100644 index 0000000..57e0b01 Binary files /dev/null and b/resources/textures/birb.png differ diff --git a/resources/textures/goblin.png b/resources/textures/goblin.png new file mode 100644 index 0000000..ae4d737 Binary files /dev/null and b/resources/textures/goblin.png differ diff --git a/resources/textures/wolfart.png b/resources/textures/wolfart.png new file mode 100644 index 0000000..8e001be Binary files /dev/null and b/resources/textures/wolfart.png differ