From 1b34b64d884c1136892a134732c8d1705a802245 Mon Sep 17 00:00:00 2001 From: aron Date: Sun, 12 Oct 2025 10:39:47 +0200 Subject: [PATCH] logo --- enemy.py | 6 +++--- water-game.py | 34 ++++++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/enemy.py b/enemy.py index 08139ce..f49c84b 100644 --- a/enemy.py +++ b/enemy.py @@ -24,11 +24,11 @@ class Enemy: if self.dir == "up": dy -= PLAYER_SPEED // 1.5 if self.dir == "down": - dy += PLAYER_SPEED // 2 + dy += PLAYER_SPEED // 1.5 if self.dir == "left": - dx -= PLAYER_SPEED // 2 + dx -= PLAYER_SPEED // 1.5 if self.dir == "right": - dx += PLAYER_SPEED // 2 + dx += PLAYER_SPEED // 1.5 self.x = max(0, min(map_w - PLAYER_SIZE // 2, self.x + dx)) self.y = max(0, min(map_h - PLAYER_SIZE // 2, self.y + dy)) self.rect.topleft = (self.x, self.y) diff --git a/water-game.py b/water-game.py index fbcd969..8e7a965 100644 --- a/water-game.py +++ b/water-game.py @@ -15,7 +15,9 @@ pygame.init() # logo_img = pygame.image.load("images/logo.png") # pygame.display.set_icon(logo_img) WIN = pygame.display.set_mode((WIDTH, HEIGHT)) -pygame.display.set_caption("Water Bottle Shooter") +pygame.display.set_caption("Wasser der Regierung") +logo_img = pygame.image.load("images/Wasser_der_Regierung.PNG") +pygame.display.set_icon(logo_img) def load_map(path): try: @@ -51,6 +53,23 @@ def draw_minimap(win, map_surface, player, enemies, bottles): for bottle in bottles: pygame.draw.circle(win, (0, 180, 255), map2mini(bottle.x, bottle.y), 3) +def show_win_screen(win): + win.fill((40, 180, 80)) + font = pygame.font.SysFont(None, 72) + text = font.render("Gewonnen!", True, (255, 255, 255)) + win.blit(text, (win.get_width() // 2 - text.get_width() // 2, win.get_height() // 2 - text.get_height() // 2)) + pygame.display.update() + pygame.time.wait(5000) + +def show_lose_screen(win): + win.fill((180, 40, 40)) + font = pygame.font.SysFont(None, 72) + text = font.render("Verloren!", True, (255, 255, 255)) + win.blit(text, (win.get_width() // 2 - text.get_width() // 2, win.get_height() // 2 - text.get_height() // 2)) + pygame.display.update() + pygame.time.wait(5000) + + def main(): from settings import PLAYER_IMG_PATH, ENEMY_IMG_PATH, HUMAN_IMG_PATH, PLAYER_SIZE, load_img player_img = load_img(PLAYER_IMG_PATH, (PLAYER_SIZE, PLAYER_SIZE)) @@ -99,13 +118,12 @@ def main(): if minimap_visible: draw_minimap(WIN, map_surface, player, enemies, bottles) pygame.display.update() - # Remove win/lose condition checks - # if not player.alive: - # show_lose_screen(WIN) - # running = False - # elif all(not e.alive or e.health <= 0 for e in enemies): - # show_win_screen(WIN) - # running = False + if not player.alive: + show_lose_screen(WIN) + running = False + elif all(not e.alive or e.health <= 0 for e in enemies): + show_win_screen(WIN) + running = False pygame.quit() sys.exit()