From 196e16b404f45952b232e2565057cd6edae73937 Mon Sep 17 00:00:00 2001 From: Yadciel Date: Tue, 25 Apr 2023 09:07:44 +0200 Subject: [PATCH] fix --- game.py | 6 +++--- object.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/game.py b/game.py index 1d4ec83..e77bd54 100644 --- a/game.py +++ b/game.py @@ -11,9 +11,9 @@ def start(): win = pygame.display.set_mode((800, 800)) player1 = player.Player(0, 0) enemy = helicopter.Helicopter(5, 5) - Erzmine = object.Erz(320, 20) - Tanken = object.Tank(50, 200) - Ziele = object.Ziel(320, 600) + Erzmine = object.Erz(600, 100) + Tanken = object.Tank(160, 200) + Ziele = object.Ziel(600, 900) tile_set = pygame.image.load("resources/roads2W.png").convert_alpha() diff --git a/object.py b/object.py index 4b968aa..272820d 100644 --- a/object.py +++ b/object.py @@ -9,7 +9,8 @@ class Erz(pygame.sprite.Sprite): super().__init__() self.image = pygame.image.load("resources/Erzmine.png").convert_alpha() self.rect = self.image.get_rect() - self.rect = x, y + self.rect.centerx = x + self.rect.centery = y def draw(self, win): groesse = pygame.transform.scale(self.image, (100, 100)) @@ -20,8 +21,10 @@ class Tank(pygame.sprite.Sprite): def __init__(self, x, y): super().__init__() self.image = pygame.image.load("resources/Tank.jpg").convert_alpha() - self.rect = self.image.get_rect() - self.rect.center = x, y + self.scaled_image = pygame.transform.scale(self.image, (self.image.get_width() / 100, self.image.get_height() / 100)) + self.rect = self.scaled_image.get_rect() + self.rect.centerx = x + self.rect.centery = y def draw(self, win): groesse = pygame.transform.scale(self.image, (100, 100)) @@ -33,7 +36,8 @@ class Ziel(pygame.sprite.Sprite): super().__init__() self.image = pygame.image.load("resources/Ziel.jpg").convert_alpha() self.rect = self.image.get_rect() - self.rect = x, y + self.rect.centerx = x + self.rect.centery = y def draw(self, win): groesse = pygame.transform.scale(self.image, (100, 100))