item rect durch Objekt ersetzt

This commit is contained in:
binaerverkehr 2026-09-26 14:12:25 +02:00
parent bfe8427392
commit bb1a796c1c

View file

@ -38,8 +38,7 @@ class Game:
self.player_pos = pygame.Vector2(self.screen.get_width() / 2, self.screen.get_height() / 2)
self.player = Player(self, self.player_pos, width=PLAYER_SIZE, height=PLAYER_SIZE)
# Items
self.item_rect = pygame.Rect(70*2, 150*2, 20, 20)
self.test_item = Item(0 ,0, 100, 100, "green")
self.test_item = Item(140 ,300, 20, 20, "blue")
# Level
self.walls = [pygame.Rect(100*2, 100*2, 20*2, 50*2), pygame.Rect(300*2, 300*2, 200*2, 20*2), pygame.Rect(550*2, 80*2, 20*2, 200*2)]
# Licht
@ -91,7 +90,7 @@ class Game:
# Licht
pygame.draw.polygon(self.screen, (243, 255, 74), self.light_points)
# Item
pygame.draw.rect(self.screen, "blue", self.item_rect)
pygame.draw.rect(self.screen, "blue", self.test_item)
# Player
self.player.render(surface=self.screen)