diff --git a/game.py b/game.py index 831d74b..ea90610 100644 --- a/game.py +++ b/game.py @@ -8,6 +8,7 @@ from helpers import draw_text from logs import Logs from stats import Stats from knight import Knight +from monster import Monster from spawner import Spawner @@ -133,9 +134,12 @@ class Game: running = False grid.draw(self.screen) - knights_list.draw(self.screen) stats.draw(self.screen) logs.draw(self.screen) + knights_list.draw(self.screen) + monster1 = Monster(self.screen, "/resources/textures/dragon.png") + monster_list = pygame.sprite.Group() + monster_list.add(monster1) pygame.display.update() self.clock.tick(FPS_COUNT) diff --git a/monster.py b/monster.py new file mode 100644 index 0000000..9b7b5e5 --- /dev/null +++ b/monster.py @@ -0,0 +1,18 @@ +import pygame.image +import random + + +class Monster(pygame.sprite.Sprite): + + def __init__(self, screen, img): + super().__init__() + self.images = [] + self.image = pygame.image.load("resources/textures/dragon.png") + self.image = pygame.transform.scale(self.image, (40, 40)) + self.images.append(self.image) + self.rect = self.image.get_rect() + monster_list = pygame.sprite.Group() + x = 337 + 41 * 5 + y = 214 + 41 * 7 + pygame.draw.rect(screen, (255, 255, 255), pygame.Rect(x, y, 40, 40), 0, 0) + screen.blit(self.image, (x, y)) diff --git a/resources/textures/dragon.png b/resources/textures/dragon.png new file mode 100644 index 0000000..9dd657b Binary files /dev/null and b/resources/textures/dragon.png differ