This commit is contained in:
Yadciel 2023-04-25 09:07:44 +02:00
parent f5537d0644
commit 196e16b404
2 changed files with 11 additions and 7 deletions

View File

@ -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()

View File

@ -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))