Merge branch 'master' of https://git.wmi.amu.edu.pl/s464965/WMICraft
Conflicts: game.py
This commit is contained in:
commit
c39aba8c30
6
game.py
6
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)
|
||||
|
18
monster.py
Normal file
18
monster.py
Normal 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))
|
BIN
resources/textures/dragon.png
Normal file
BIN
resources/textures/dragon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue
Block a user