-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (26 loc) · 881 Bytes
/
main.py
File metadata and controls
35 lines (26 loc) · 881 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
29
30
31
32
33
34
35
import pygame
from cv import PoseEstimator
from menus import HomeMenu
from constants import *
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT), pygame.FULLSCREEN)
pygame.display.set_caption(f"WebcamWare {VERSION}")
pygame.display.gl_set_attribute(pygame.GL_MULTISAMPLEBUFFERS, 3)
pygame.display.set_icon(pygame.image.load('assets/img/menus/intergame/webcam.png'))
clock = pygame.time.Clock()
pygame.mixer.music.load('assets/music/background.mp3')
pygame.mixer.music.set_volume(0.5)
pygame.mixer.music.play(-1)
menu = HomeMenu(screen)
PoseEstimator().start_tracking()
while True:
for event in pygame.event.get():
new_menu = menu.handle_event(event)
if new_menu:
menu = new_menu
new_menu = menu.draw()
if new_menu:
menu = new_menu
pygame.display.update()
clock.tick(60)