Conflicts:
	game.py
This commit is contained in:
XsedoX 2022-03-10 22:15:24 +01:00
commit c39aba8c30
3 changed files with 23 additions and 1 deletions

View File

@ -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)

18
monster.py Normal file
View File

@ -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))

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB