code-check-jay #1

Open
jimdahl wants to merge 19 commits from code-check-jay into main
Showing only changes of commit 2b31c1de54 - Show all commits

12
game.py
View file

@ -50,13 +50,10 @@ class Game:
self.player.speed = 150
self.player.update(walls=self.walls, dt=self.dt)
self.create_light_points()
def render(self) -> None:
self.display.fill((0, 0, 0, 0))
"""RAYCASTING"""
ray_end = pygame.Vector2()
def create_light_points(self):
self.light_points = []
vector = pygame.Vector2(LIGHT_RADIUS, 0)
@ -73,6 +70,11 @@ class Game:
ray_end = schnittpunkt
self.light_points.append(ray_end)
def render(self) -> None:
self.display.fill((0, 0, 0, 0))
self.flashlight_rect = pygame.draw.polygon(self.display, (243, 255, 74), self.light_points)
pygame.draw.rect(self.display, (255, 0, 0), self.flashlight_rect, 1)
self.player.render(surface=self.display)