This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test500.py
72 lines (57 loc) · 1.84 KB
/
Test500.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/python3
import sys
import pygame
from GameFrame import Globals
Globals.FRAMES_PER_SECOND = 100000
pygame.mixer.pre_init(44100, -16, 2, 2048)
pygame.mixer.init()
pygame.init()
pygame.font.init()
pygame.display.set_caption(Globals.window_name)
window_size = (Globals.SCREEN_WIDTH, Globals.SCREEN_HEIGHT)
screen = pygame.display.set_mode(window_size,
pygame.DOUBLEBUF, 32)
bluewins=0;
redwins=0;
numoftests=50
for i in range(numoftests):
print(Globals.winner)
if Globals.winner=="Red":
redwins +=1
Globals.SCORE=0
Globals.background_music =0
Globals.LIVES=3
Globals.red_bots=[]
Globals.blue_bots=[]
Globals.red_enemy_side_time=0
Globals.blue_enemy_side_time=0
Globals.red_flag=0
Globals.blue_flag=0
Globals.winner=' '
Globals.next_level = Globals.start_level
levels = Globals.levels
# - Main Game Loop. Steps through the levels defined in levels[] - #
while Globals.running:
curr_level = Globals.next_level
Globals.next_level += 1
Globals.next_level %= len(levels)
mod_name = "Rooms.{}".format(levels[curr_level])
mod = __import__(mod_name)
class_name = getattr(mod, levels[curr_level])
room = class_name(screen)
exit_val = room.run()
if exit_val is True or Globals.running is False:
# print(Globals.winner)
# if Globals.winner=="Red":
# redwins +=1
Globals.next_level = Globals.end_game_level
if len(levels) == 1:
break
if Globals.exiting:
# print(Globals.winner)
# if Globals.winner=="Red":
# redwins+=1
break
print(f"""red wins: {redwins} win% = {redwins/100}%
blue wins: {numoftests-redwins} win% = {(numoftests-redwins)/100}%"""
)