-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
37 lines (27 loc) · 1.02 KB
/
main.py
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
29
30
31
32
33
34
35
36
37
import pygame
from settings import *
from player import Player
from map import world_map
from ray_casting import ray_casting
import math
pygame.init()
sc = pygame.display.set_mode((WIDTH, HEIGHT))
clock = pygame.time.Clock()
player = Player()
do_game = True
while do_game:
for event in pygame.event.get():
if event.type == pygame.QUIT:
do_game = False
player.movement()
sc.fill(BLACK)
pygame.draw.rect(sc, BLUE, (0, 0, WIDTH, HALF_HEIGHT))
pygame.draw.rect(sc, DARK_GRAY, (0, HALF_HEIGHT, WIDTH, HALF_HEIGHT))
ray_casting(sc, player.pos, player.angle)
#pygame.draw.circle(sc, GREEN, (int(player.x), int(player.y)), 12)
#pygame.draw.line(sc, GREEN, (int(player.x), int(player.y)), (int(player.x + WIDTH * math.cos(player.angle)),
# int(player.y + HEIGHT * math.sin(player.angle))))
#for x, y in world_map:
# pygame.draw.rect(sc, DARK_GRAY, (x, y, TILE, TILE), 2)
pygame.display.flip()
clock.tick(FPS)