diff --git a/__pycache__/agent.cpython-39.pyc b/__pycache__/agent.cpython-39.pyc index 90d37a9..bc6dce4 100644 Binary files a/__pycache__/agent.cpython-39.pyc and b/__pycache__/agent.cpython-39.pyc differ diff --git a/agent.py b/agent.py index 7ad3f8a..746d94b 100644 --- a/agent.py +++ b/agent.py @@ -34,12 +34,14 @@ class Agent(pygame.sprite.Sprite): self.max_health = 1000 self.health_bar_length = 300 self.health_ratio = self.max_health/self.health_bar_length + def update(self): self.health_bar() self.movement() self.collide_mob() + self.disp_level() self.rect.x += self.x_change self.collide_blocks('x') @@ -154,8 +156,11 @@ class Agent(pygame.sprite.Sprite): pygame.draw.rect(self.game.SCREEN, (0,255,0), (10,780,self.current_health/self.health_ratio,25)) pygame.draw.rect(self.game.SCREEN, (255,255,255), (10,780,self.health_bar_length, 25),2) - - + def disp_level(self): + font = pygame.font.SysFont(None, 40) + lvlDisplay = font.render(str(self.level), 1, WHITE) + pygame.draw.rect(self.game.SCREEN, BLACK, (370, 780, 40, 40)) + self.game.SCREEN.blit(lvlDisplay, (370,780)) # brakuje levelowania postaci gdy zabije moba, jest zrobione tylko, że jeśli za wysoki poziom, lub brak życia to ginie i od nowa zaczyna # brakuje dodania miejsca w którym agent się leczy diff --git a/main.py b/main.py index 03c06e6..68118cf 100644 --- a/main.py +++ b/main.py @@ -19,6 +19,9 @@ class Game: self.BACKGROUND_IMG= pygame.image.load("./zdjecia/podloze.jpg") self.BACKGROUND = pygame.transform.scale(self.BACKGROUND_IMG,(64,64)) + self.LVL_ICON_PNG = pygame.image.load("./zdjecia/lvl_icon.png") + self.LVL_ICON = pygame.transform.scale(self.LVL_ICON_PNG,(24,24)) + #self.ORK_LIST = [self.ARCHER_ORK,self.INFANTRY_ORK2, self.INFATRY_ORK] pygame.display.set_caption('Do_Nazwania') @@ -60,6 +63,7 @@ class Game: pygame.draw.rect(self.SCREEN, BLACK, self.rect, 1) self.all_sprites.draw(self.SCREEN) self.rock_sprites.draw(self.SCREEN) + self.SCREEN.blit(self.LVL_ICON, (340 ,780)) pygame.display.update() def main(self): diff --git a/zdjecia/lvl_icon.png b/zdjecia/lvl_icon.png new file mode 100644 index 0000000..ef1090a Binary files /dev/null and b/zdjecia/lvl_icon.png differ