diff --git a/__pycache__/agent.cpython-310.pyc b/__pycache__/agent.cpython-310.pyc index f031cfc..8c9f5e9 100644 Binary files a/__pycache__/agent.cpython-310.pyc and b/__pycache__/agent.cpython-310.pyc differ diff --git a/__pycache__/archer_ork.cpython-310.pyc b/__pycache__/archer_ork.cpython-310.pyc new file mode 100644 index 0000000..4584ef1 Binary files /dev/null and b/__pycache__/archer_ork.cpython-310.pyc differ diff --git a/__pycache__/config.cpython-310.pyc b/__pycache__/config.cpython-310.pyc index 8a7847d..3e5759b 100644 Binary files a/__pycache__/config.cpython-310.pyc and b/__pycache__/config.cpython-310.pyc differ diff --git a/__pycache__/infantry_ork.cpython-310.pyc b/__pycache__/infantry_ork.cpython-310.pyc new file mode 100644 index 0000000..a732aec Binary files /dev/null and b/__pycache__/infantry_ork.cpython-310.pyc differ diff --git a/__pycache__/infantry_ork2.cpython-310.pyc b/__pycache__/infantry_ork2.cpython-310.pyc new file mode 100644 index 0000000..c9f3552 Binary files /dev/null and b/__pycache__/infantry_ork2.cpython-310.pyc differ diff --git a/__pycache__/map_add_ons.cpython-310.pyc b/__pycache__/map_add_ons.cpython-310.pyc index 447c7ff..2e6e836 100644 Binary files a/__pycache__/map_add_ons.cpython-310.pyc and b/__pycache__/map_add_ons.cpython-310.pyc differ diff --git a/__pycache__/sauron.cpython-310.pyc b/__pycache__/sauron.cpython-310.pyc new file mode 100644 index 0000000..a9ae9df Binary files /dev/null and b/__pycache__/sauron.cpython-310.pyc differ diff --git a/agent.py b/agent.py index 5834856..52a2876 100644 --- a/agent.py +++ b/agent.py @@ -28,7 +28,7 @@ class Agent(pygame.sprite.Sprite): self.rect.x = self.x self.rect.y = self.y - self.health = 100 + self.level = 1 def update(self): self.movement() diff --git a/archer_ork.py b/archer_ork.py new file mode 100644 index 0000000..8b886fb --- /dev/null +++ b/archer_ork.py @@ -0,0 +1,28 @@ +import pygame +from config import * + +class Archer_ork(pygame.sprite.Sprite): + + + def __init__(self, game, x, y): + self.game = game + self.groups = self.game.all_sprites + pygame.sprite.Sprite.__init__(self, self.groups) + + self.x = x * TILE_SIZE + self.y = y * TILE_SIZE + self.width = TILE_SIZE + self.height = TILE_SIZE + + self.ARCHER_ORK_IMG = pygame.image.load("./zdjecia/ork_lucznik.png") + self.ARCHER_ORK = pygame.transform.scale(self.ARCHER_ORK_IMG,(64,64)) + + self.image = pygame.Surface([self.width, self.height]) + self.image.blit(self.ARCHER_ORK, (0,0)) + self.image.set_colorkey((0, 0, 0)) + + self.rect = self.image.get_rect() + self.rect.x = self.x + self.rect.y = self.y + + self.level = 1 \ No newline at end of file diff --git a/infantry_ork.py b/infantry_ork.py new file mode 100644 index 0000000..11a77a6 --- /dev/null +++ b/infantry_ork.py @@ -0,0 +1,28 @@ +import pygame +from config import * + +class Infantry_ork(pygame.sprite.Sprite): + + + def __init__(self, game, x, y): + self.game = game + self.groups = self.game.all_sprites + pygame.sprite.Sprite.__init__(self, self.groups) + + self.x = x * TILE_SIZE + self.y = y * TILE_SIZE + self.width = TILE_SIZE + self.height = TILE_SIZE + + self.INFANTRY_ORK_IMG = pygame.image.load("./zdjecia/ork-piechota.png") + self.INFANTRY_ORK = pygame.transform.scale(self.INFANTRY_ORK_IMG,(64,64)) + + self.image = pygame.Surface([self.width, self.height]) + self.image.blit(self.INFANTRY_ORK, (0,0)) + self.image.set_colorkey((0, 0, 0)) + + self.rect = self.image.get_rect() + self.rect.x = self.x + self.rect.y = self.y + + self.level = 2 \ No newline at end of file diff --git a/infantry_ork2.py b/infantry_ork2.py new file mode 100644 index 0000000..2e77bf0 --- /dev/null +++ b/infantry_ork2.py @@ -0,0 +1,28 @@ +import pygame +from config import * + +class Infantry_ork2(pygame.sprite.Sprite): + + + def __init__(self, game, x, y): + self.game = game + self.groups = self.game.all_sprites + pygame.sprite.Sprite.__init__(self, self.groups) + + self.x = x * TILE_SIZE + self.y = y * TILE_SIZE + self.width = TILE_SIZE + self.height = TILE_SIZE + + self.INFANTRY_ORK2_IMG = pygame.image.load("./zdjecia/ork-piechota2.png") + self.INFANTRY_ORK2 = pygame.transform.scale(self.INFANTRY_ORK2_IMG,(64,64)) + + self.image = pygame.Surface([self.width, self.height]) + self.image.blit(self.INFANTRY_ORK2, (0,0)) + self.image.set_colorkey((0, 0, 0)) + + self.rect = self.image.get_rect() + self.rect.x = self.x + self.rect.y = self.y + + self.level = 3 \ No newline at end of file diff --git a/main.py b/main.py index a36410b..e846585 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,10 @@ import pygame from config import * from agent import * from map_add_ons import * +from archer_ork import * +from infantry_ork import * +from infantry_ork2 import * +from sauron import * class Game: @@ -10,19 +14,8 @@ class Game: self.SCREEN = pygame.display.set_mode((WIDTH, HEIGHT)) self.running = True self.clock = pygame.time.Clock() - - # te wszystkie obrazki trzeba dać w oddzielnej klasie dla potworków jak coś później - #self.ARCHER_ORK_IMG = pygame.image.load("./zdjecia/ork_lucznik.png") - #self.INFATRY_ORK_IMG = pygame.image.load("./zdjecia/ork-piechota.png") - #self.INFANTRY_ORK2_IMG = pygame.image.load("./zdjecia/ork-piechota2.png") - #self.SAURON_IMG = pygame.image.load("./zdjecia/sauron.png") + self.BACKGROUND_IMG= pygame.image.load("./zdjecia/podloze.jpg") - - - #self.ARCHER_ORK = pygame.transform.scale(self.ARCHER_ORK_IMG,(64,64)) - #self.INFATRY_ORK = pygame.transform.scale(self.INFATRY_ORK_IMG,(64,64)) - #self.INFANTRY_ORK2 = pygame.transform.scale(self.INFANTRY_ORK2_IMG,(64,64)) - #self.SAURON = pygame.transform.scale(self.SAURON_png,(64,64)) self.BACKGROUND = pygame.transform.scale(self.BACKGROUND_IMG,(64,64)) #self.ORK_LIST = [self.ARCHER_ORK,self.INFANTRY_ORK2, self.INFATRY_ORK] @@ -33,6 +26,10 @@ class Game: self.all_sprites = pygame.sprite.LayeredUpdates() self.rock_sprites = pygame.sprite.Group() self.agent = Agent(self,1,1) + self.archer_ork = Archer_ork(self,10,10) + self.infantry_ork = Infantry_ork(self,5,10) + self.infantry_ork2 = Infantry_ork2(self,6,9) + self.sauron = Sauron(self, 1, 10) for y in range(5): self.rock = Rocks(self,3,y) diff --git a/sauron.py b/sauron.py new file mode 100644 index 0000000..bd22ae0 --- /dev/null +++ b/sauron.py @@ -0,0 +1,28 @@ +import pygame +from config import * + +class Sauron(pygame.sprite.Sprite): + + + def __init__(self, game, x, y): + self.game = game + self.groups = self.game.all_sprites + pygame.sprite.Sprite.__init__(self, self.groups) + + self.x = x * TILE_SIZE + self.y = y * TILE_SIZE + self.width = TILE_SIZE + self.height = TILE_SIZE + + self.SAURON_IMG = pygame.image.load("./zdjecia/sauron.png") + self.SAURON = pygame.transform.scale(self.SAURON_IMG,(64,64)) + + self.image = pygame.Surface([self.width, self.height]) + self.image.blit(self.SAURON, (0,0)) + self.image.set_colorkey((0, 0, 0)) + + self.rect = self.image.get_rect() + self.rect.x = self.x + self.rect.y = self.y + + self.level = 4 \ No newline at end of file