This repository was archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (39 loc) · 1.3 KB
/
main.py
File metadata and controls
54 lines (39 loc) · 1.3 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'''
PCTO - One Two Code
Our github page: https://github.com/PCTO-OneTwoCode
'''
'''---------------------------
INCLUDE LIBRARIES
---------------------------'''
import time
import sys
import pygame
from Libraries.startMenu.startMenu import menu
from GraphicMain.gameDesign import mainGraphic
from GraphicMain.calibration import calibrationTest
from config import *
#initialize pygame
pygame.init()
def main():
#this variable contains the returned value from the start menu
exitMenu = -1
#this variable contains the returned value from the game
exitGame = -1
#this variable is false if the sound is muted else it si true
silent = False
#this global variable contain the game screen
global screen
screen = pygame.display.set_mode((WINDOW_WIDTH,WINDOW_HEIGHT))
#while the menu isn't equal to 0, it runs the code
while exitMenu != 0:
#first it calls the start menu that return 2 variables
exitMenu, silent = menu(screen, silent)
#if exitMenu is equal to 0, the program ends
if exitMenu == 0:
exit(0)
elif exitMenu == 1: #otherwise it starts the gameplay window
lowerBound = calibrationTest()
mainGraphic(screen, silent, lowerBound)
#this run the main function
if __name__ == "__main__":
main()