Game.light_radius durch Konstante LIGHT_RADIUS ersetzt.
This commit is contained in:
parent
fd9018d0f1
commit
48cda170dd
1 changed files with 2 additions and 2 deletions
4
game.py
4
game.py
|
|
@ -3,6 +3,7 @@ import pygame
|
||||||
SCREEN_WIDTH = 1280
|
SCREEN_WIDTH = 1280
|
||||||
SCREEN_HEIGHT = 720
|
SCREEN_HEIGHT = 720
|
||||||
PLAYER_SIZE = 20
|
PLAYER_SIZE = 20
|
||||||
|
LIGHT_RADIUS = 75
|
||||||
|
|
||||||
|
|
||||||
class Game:
|
class Game:
|
||||||
|
|
@ -28,7 +29,6 @@ class Game:
|
||||||
self.light_points: list[pygame.Vector2] = []
|
self.light_points: list[pygame.Vector2] = []
|
||||||
# Level
|
# Level
|
||||||
self.walls = [pygame.Rect(100, 100, 20, 50), pygame.Rect(300, 300, 200, 20), pygame.Rect(550, 80, 20, 200)]
|
self.walls = [pygame.Rect(100, 100, 20, 50), pygame.Rect(300, 300, 200, 20), pygame.Rect(550, 80, 20, 200)]
|
||||||
self.light_radius = 75
|
|
||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
while self.running:
|
while self.running:
|
||||||
|
|
@ -72,7 +72,7 @@ class Game:
|
||||||
"""RAYCASTING"""
|
"""RAYCASTING"""
|
||||||
ray_end = pygame.Vector2()
|
ray_end = pygame.Vector2()
|
||||||
self.light_points = []
|
self.light_points = []
|
||||||
vector = pygame.Vector2(self.light_radius, 0)
|
vector = pygame.Vector2(LIGHT_RADIUS, 0)
|
||||||
|
|
||||||
# Lichtstrahlen berechnen
|
# Lichtstrahlen berechnen
|
||||||
for i in range(360):
|
for i in range(360):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue