-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathLoop.py
More file actions
28 lines (22 loc) · 672 Bytes
/
Loop.py
File metadata and controls
28 lines (22 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pygame
import Config
import tile_map
import light_handling
win = pygame.display.set_mode(Config.WINDOW_SIZE)
clock = pygame.time.Clock()
map = tile_map.Tile_map()
light = light_handling.light_handling(map.walls, map.points)
flag = True
while flag:
clock.tick(Config.FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
flag = False
mouse_pos = pygame.mouse.get_pos()
mouse_pressed = pygame.mouse.get_pressed()
map.update_variables(mouse_pos, mouse_pressed, light)
light.update_variables(mouse_pos, mouse_pressed)
win.fill((0,0,0))
light.draw(win)
map.draw(win)
pygame.display.update()