-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbreakthebank.py
575 lines (499 loc) · 26.6 KB
/
breakthebank.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
#--------------------------------------------------------
# Import and initialize the pygame library
#--------------------------------------------------------
import pygame, os, random, sys
from settings import *
from tiles import Tile
from level import Level
from statemachine import StateMachine, State
pygame.init()
pygame.mixer.init()
#pygame.mixer.music.set_volume(0.01)
#--------------------------------------------------------
# Check if the images are loaded
#--------------------------------------------------------
if not os.path.exists("imgs"):
print("you do not have imgs folder")
#--------------------------------------------------------
# Sets the bar icon and text for game window
# Defines size for convert()
#--------------------------------------------------------
pygame.display.set_caption('Break the Bank')
gameicon = pygame.image.load("imgs/game_icon.png")
pygame.display.set_icon(gameicon)
size = 80
levels_to_draw = 4
button_hover = pygame.mixer.Sound('audio/sfx/button_hover.mp3')
button_hover.set_volume(1.0)
esc_click = pygame.mixer.Sound('audio/sfx/esc_click.wav')
esc_click.set_volume(1.0)
#--------------------------------------------------------
# Define Drawing States
#--------------------------------------------------------
class CurrentScene(StateMachine):
scene_main_menu = State("mainMenu", initial = True)
scene_level_selection = State("Level Selection")
scene_in_game = State("In Game")
scene_pause_menu = State("Paused")
scene_death_menu = State("Death")
scene_win_menu = State("Completed Level")
global levels_to_draw
musicON = True
audioTog = True
# to create new scene, declare, create a variable for it, put it in init on_transition, and update the update var
go_to_next_scene = scene_main_menu.to(scene_level_selection, cond = "select_stage") | scene_level_selection.to(scene_main_menu, cond = "main_menu") | scene_level_selection.to(
scene_in_game, cond = "in_game") | scene_in_game.to(scene_main_menu, cond = "main_menu") | scene_in_game.to(
scene_pause_menu, cond = "pause_menu") | scene_pause_menu.to(scene_in_game, cond = "in_game") | scene_pause_menu.to(scene_level_selection, cond = "select_stage") | scene_in_game.to(
scene_death_menu, cond = "death_menu")| scene_death_menu.to(scene_level_selection, cond = "select_stage") | scene_death_menu.to(scene_in_game, cond = "in_game") | scene_in_game.to(
scene_win_menu, cond = "win_menu")| scene_win_menu.to(scene_level_selection, cond = "select_stage") | scene_win_menu.to(scene_in_game, cond = "in_game")
update = scene_main_menu.to.itself(on="drawMainMenu") | scene_level_selection.to.itself(on="drawStageSelection") | scene_in_game.to.itself(
on="drawInGame") | scene_pause_menu.to.itself(on="drawPauseMenu") | scene_death_menu.to.itself(on="drawDeathMenu") | scene_win_menu.to.itself(on="drawWinMenu")
def __init__(self):
# self.calls = []
self.select_stage = False
self.main_menu = False
self.in_game = False
self.pause_menu = False
self.death_menu = False
self.win_menu = False
self.curr_screen = screen.copy()
self.current_level = ""
self.current_level_parems = ""
self.current_level_bg = ""
super().__init__()
print("DEF INIT")
def on_transition(self):
self.select_stage = False
self.main_menu = False
self.in_game = False
self.pause_menu = False
self.death_menu = False
self.win_menu = False
# print("ON_TRANSITION")
def checkChange(self):
if self.select_stage | self.main_menu | self.in_game | self.pause_menu | self.death_menu | self.win_menu:
return True
#-------------MAIN MENU-------------
def drawMainMenu(self):
if self.musicON is True:
bgm_ch.play(lobbyMusic, loops=-1, fade_ms=100)
self.musicON = False
print("bgm_ch play lobbyMusic")
mainMenu.update()
for event in pygame.event.get():
mouse = pygame.mouse.get_pos()
if event.type == pygame.QUIT:
self.running = False
if event.type == pygame.MOUSEBUTTONDOWN:
if start_button.isOver(mouse):
button_hover.play()
self.select_stage = True
print("TRIGGERED start game")
if audio_button.isOver(mouse):
if self.audioTog is True:
bgm_ch.set_volume(0.0)
self.audioTog = False
elif self.audioTog is False:
bgm_ch.set_volume(0.3)
self.audioTog = True
if quit_button.isOver(mouse):
button_hover.play()
sys.exit()
pygame.quit()
if event.type == pygame.KEYDOWN: #temp to get coords
if event.key == pygame.K_RETURN:
print(mouse)
#-------------STAGE SELECTION-------------
def drawStageSelection(self):
if self.musicON is False:
bgm_ch.play(selectMusic, loops=-1, fade_ms=100)
self.musicON = True
print("bgm_ch play selectMusic")
stageSelection.update()
mouse = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
if (stage_placeholderbutton_1.isOver(mouse) and 1<=levels_to_draw):
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_0
self.current_level_parems = level0_param
self.current_level_bg = "./imgs/stage1_lobby.png"
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage1_lobby.png")
self.in_game = True
if (stage_placeholderbutton_2.isOver(mouse) and 2<=levels_to_draw):
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_1
self.current_level_parems = level1_param
self.current_level_bg = "./imgs/stage2_basement.png"
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage2_basement.png")
self.in_game = True
if (stage_placeholderbutton_3.isOver(mouse) and 3<=levels_to_draw):
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_3
self.current_level_parems = level3_param
self.current_level_bg = "./imgs/stage3_offices.png"
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage3_offices.png")
self.in_game = True
if (stage_placeholderbutton_4.isOver(mouse) and 4<=levels_to_draw):
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_4
self.current_level_parems = level4_param
self.current_level_bg = "./imgs/stage4_executive.png"
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage4_executive.png")
self.in_game = True
if (stage_placeholderbutton_5.isOver(mouse) and 5<=levels_to_draw):
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_1
self.current_level_parems = level1_param
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage1_lobby.png")
self.in_game = True
if (stage_placeholderbutton_6.isOver(mouse) and 6<=levels_to_draw):
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_1
self.current_level_parems = level1_param
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage1_lobby.png")
self.in_game = True
if quit_mainmenu_button.isOver(mouse):
button_hover.play()
self.main_menu = True
#-------------IN GAME-------------
def drawInGame(self):
# game_stage()
if self.musicON is True:
if self.current_level == level_map_0:
bgm_ch.play(menuMusic, loops=-1, fade_ms=100)
elif self.current_level == level_map_1:
bgm_ch.play(basementMusic, loops=-1, fade_ms=100)
elif self.current_level == level_map_3:
bgm_ch.play(officeMusic, loops=-1, fade_ms=100)
self.musicON = False
print("bgm_ch play menuMusic")
screen.fill('black')
keep_running, outcome = self.level.run()
if not keep_running:
if outcome == "loss":
self.curr_screen = screen.copy()
self.death_menu = True
else:
self.curr_screen = screen.copy()
self.win_menu = True
mouse = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
# put physics stuff here to remember when unpausing
esc_click.play()
self.curr_screen = screen.copy()
self.pause_menu = True
# if event.key == pygame.K_RETURN:
# button_hover.play()
# self.main_menu = True
#-------------PAUSE MENU-------------
def drawPauseMenu(self):
if self.musicON is False:
bgm_ch.pause()
self.musicON = True
print("====pause menu stop music")
screen.blit(self.curr_screen,(0,0))
pauseMenu.update()
mouse = pygame.mouse.get_pos()
if tutorial_button.isOver(mouse):
screen.blit(tutorialMenu, (0,0))
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
if continue_button.isOver(mouse):
button_hover.play()
self.in_game = True
if quit_button.isOver(mouse):
button_hover.play()
self.musicON = False
self.select_stage = True
if restart_button.isOver(mouse):
self.level = Level(self.current_level, self.current_level_parems, screen, self.current_level_bg)
self.in_game = True
self.musicON = True
if audio_button.isOver(mouse):
if self.audioTog is True:
bgm_ch.set_volume(0.0)
self.audioTog = False
elif self.audioTog is False:
bgm_ch.set_volume(0.3)
self.audioTog = True
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE: # go back to game
esc_click.play()
self.in_game = True
#-------------DEATH MENU-------------
def drawDeathMenu(self):
if self.musicON is False:
bgm_ch.pause()
self.musicON = True
print("====pause menu stop music")
screen.blit(self.curr_screen,(0,0))
deathMenu.update()
mouse = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
if audio_button.isOver(mouse):
if self.audioTog is True:
bgm_ch.set_volume(0.0)
self.audioTog = False
elif self.audioTog is False:
bgm_ch.set_volume(0.3)
self.audioTog = True
if quit_button.isOver(mouse):
button_hover.play()
self.musicON = False
self.select_stage = True
if restart_button.isOver(mouse):
self.level = Level(self.current_level, self.current_level_parems, screen, self.current_level_bg)
self.in_game = True
self.musicON = True
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE: # go back to game
esc_click.play()
self.select_stage = True
def drawWinMenu(self):
if self.musicON is False:
bgm_ch.pause()
self.musicON = True
print("====pause menu stop music")
screen.blit(self.curr_screen,(0,0))
winMenu.update()
mouse = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.MOUSEBUTTONDOWN:
if audio_button.isOver(mouse):
if self.audioTog is True:
bgm_ch.set_volume(0.0)
self.audioTog = False
elif self.audioTog is False:
bgm_ch.set_volume(0.3)
self.audioTog = True
if continue_button.isOver(mouse):
if self.current_level == level_map_0:
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_1
self.current_level_parems = level1_param
self.current_level_bg = "./imgs/stage2_basement.png"
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage2_basement.png")
self.in_game = True
elif self.current_level == level_map_1:
button_hover.play()
print("TRIGGERED stage selection -> in game")
self.current_level = level_map_3
self.current_level_parems = level3_param
self.current_level_bg = "./imgs/stage3_offices.png"
self.level = Level(self.current_level, self.current_level_parems, screen, "./imgs/stage3_offices.png")
self.in_game = True
if quit_button.isOver(mouse):
button_hover.play()
self.musicON = False
self.select_stage = True
if restart_button.isOver(mouse):
self.level = Level(self.current_level, self.current_level_parems, screen, self.current_level_bg)
self.in_game = True
self.musicON = True
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE: # go back to game
esc_click.play()
self.select_stage = True
#--------------------------------------------------------
# Define Drawing Scenes
#--------------------------------------------------------
class Scene():
def __init__(self, screen, background, buttonArray, transparency = False):
self.screen = screen
self.buttons = buttonArray
# self.states = stateArray
self.background = background
self.transparency = transparency
def update(self):
if self.transparency:
# screen.blit(self.screen,(0,0))
backgroundphoto = pygame.image.load(self.background)
backgroundphoto = pygame.transform.scale(backgroundphoto, (size*16,size*9))
backgroundphoto.set_alpha(250)
screen.blit(backgroundphoto, (0,0))
for individualButton in range(len(self.buttons)):
self.buttons[individualButton].draw(screen)
else:
# print(self.buttons)
backgroundphoto = pygame.image.load(self.background).convert()
backgroundphoto = pygame.transform.scale(backgroundphoto, (size*16,size*9))
screen.blit(backgroundphoto,(0,0))
for individualButton in range(len(self.buttons)):
self.buttons[individualButton].draw(self.screen)
#--------------------------------------------------------
# Define buttons
#--------------------------------------------------------
class button():
def __init__(self, x,y,width,height, text='', color = None,image=None, hovering_image=None, amplifier=None):
self.color = color
self.x = x
self.y = y
self.width = width
self.height = height
self.text = text
self.image = image
self.hovering_image = hovering_image
self.amplifier = amplifier
def draw(self,win,outline=None):
#Call this method to draw the button on the screen
if self.color != None:
if outline:
pygame.draw.rect(win, outline, (self.x-2,self.y-2,self.width+4,self.height+4),0)
pygame.draw.rect(win, self.color, (self.x,self.y,self.width,self.height),0)
if self.text != '':
font = pygame.font.SysFont('comicsans', 60)
text = font.render(self.text, 1, (0,0,0))
win.blit(text, (self.x + (self.width/2 - text.get_width()/2), self.y + (self.height/2 - text.get_height()/2)))
if self.image != None:
if self.amplifier == None:
if not self.isOver(pygame.mouse.get_pos()):
image = pygame.image.load(self.image)
rect_image = image.get_rect()
image = pygame.transform.scale(image, ((rect_image.width/(237.5*16))*size*16,(rect_image.height/(237.5*9))*size*9))
else:
image = pygame.image.load(self.hovering_image)
rect_image = image.get_rect()
image = pygame.transform.scale(image, ((rect_image.width/(237.5*16))*size*16,(rect_image.height/(237.5*9))*size*9))
else:
if not self.isOver(pygame.mouse.get_pos()):
image = pygame.image.load(self.image)
rect_image = image.get_rect()
#print(rect_image)
image = pygame.transform.scale(image, ((rect_image.width/(self.amplifier*16))*size*16,(rect_image.height/(self.amplifier*9))*size*9))
else:
image = pygame.image.load(self.hovering_image)
rect_image = image.get_rect()
image = pygame.transform.scale(image, ((rect_image.width/(self.amplifier*16))*size*16,(rect_image.height/(self.amplifier*9))*size*9))
win.blit(image, (self.x, self.y))
def isOver(self, pos):
#Pos is the mouse position or a tuple of (x,y) coordinates
if self.image == None:
if pos[0] > self.x and pos[0] < self.x + self.width:
if pos[1] > self.y and pos[1] < self.y + self.height:
return True
return False
elif self.amplifier == None:
image = pygame.image.load(self.image)
rect_image = image.get_rect()
if pos[0] > self.x and pos[0] < self.x + (rect_image.width/(237.5*16))*size*16:
if pos[1] > self.y and pos[1] < self.y + (rect_image.height/(237.5*9))*size*9:
return True
return False
else:
image = pygame.image.load(self.image)
rect_image = image.get_rect()
if pos[0] > self.x and pos[0] < self.x + (rect_image.width/(self.amplifier*16))*size*16:
if pos[1] > self.y and pos[1] < self.y + (rect_image.height/(self.amplifier*9))*size*9:
return True
return False
#--------------------------------------------------------
# Load background music
#--------------------------------------------------------
lobbyMusic = pygame.mixer.Sound("audio\stage1_bgm_spookydarkpad.mp3") ; lobbyMusic.set_volume(1.0)
selectMusic = pygame.mixer.Sound("audio\stageselect_syndicate.mp3"); selectMusic.set_volume(0.4)
menuMusic = pygame.mixer.Sound("audio\duskwalkinloop.wav"); menuMusic.set_volume(0.4)
basementMusic = pygame.mixer.Sound("audio\pianoloops.wav"); basementMusic.set_volume(0.4)
officeMusic = pygame.mixer.Sound("audio\dventurerloop.mp3"); officeMusic.set_volume(0.4)
bgm_ch = pygame.mixer.Channel(0)
bgm_ch.set_volume(0.3)
bgm_ch.play(lobbyMusic, loops = -1, fade_ms = 500)
#--------------------------------------------------------
# Set up the drawing window
#--------------------------------------------------------
screen = pygame.display.set_mode([size*16, size*9])
# screen = pygame.transform.scale(backgroundphoto,[859, 727])
width = screen.get_width()
height = screen.get_height()
# tile_size = 45
# height = len(level_map) * tile_size
# width = len(level_map[0])
# print(width)
start_button = button(width/2.807,height/1.6,20,100,'',None,"imgs/buttons/slice_start.png","imgs/buttons/hovering_slice_start.png")
quit_button = button(width/2.2,height/1.3,20,100,'',None,"imgs/buttons/slice_quit.png", "imgs/buttons/hovering_slice_quit.png")
quit_mainmenu_button = button(width/20,height/20,20,100,'',None,"imgs/buttons/slice_quit.png", "imgs/buttons/hovering_slice_quit.png")
audio_button = button(width/2.015748,height/1.15,20,100,'',None,"imgs/buttons/slice_audio.png", "imgs/buttons/hovering_slice_audio.png")
accessibility_button = button(width/2.4063063,height/1.15,20,100,'',None,"imgs/buttons/slice_cb.png", "imgs/buttons/hovering_slice_cb.png")
continue_button = button(width/2.4288,height/2.1951219, 20, 100, '', None, "imgs/buttons/slice_continue.png","imgs/buttons/hovering_slice_continue.png",160)
restart_button = button(width/2.4015,height/1.75182, 20, 100, '', None, "imgs/buttons/slice_restart.png","imgs/buttons/hovering_slice_restart.png",160)
tutorial_button = button(width/2.424242,height/1.50627, 20, 100, '', None, "imgs/buttons/slice_tutorial.png","imgs/buttons/hovering_slice_tutorial.png",160)
pause_title = button(width/3.12195,height/11.6129, 20, 100, '', None, "imgs/slice_paused.png","imgs/slice_paused.png",160) #bad code
death_title = button(width/5.62195,height/6.6129, 20, 100, '', None, "imgs/slice_gameover.png","imgs/slice_gameover.png",160) #bad code
win_title = button(width/6.62195,height/6.6129, 20, 100, '', None, "imgs/slice_completed.png","imgs/slice_completed.png",120) #bad code
# TODO: placeholders for Stage Selection Menu
stage_placeholderbutton_1 = button(width/8,height/4,0,20,'',None,"imgs/1f.png","imgs/1f_hover.png")
stage_placeholderbutton_2 = button(width/8+0.85*(width/3),height/4,0,20,'',None,"imgs/b.png","imgs/b_hover.png")
stage_placeholderbutton_3 = button(width/8+1.7*(width/3),height/4,0,20,'',None,"imgs/2f.png","imgs/2f_hover.png")
stage_placeholderbutton_4 = button(width/8,height/4+(height/3),0,20,'',None,"imgs/3f.png","imgs/3f_hover.png")
stage_placeholderbutton_5 = button(width/8+1*(width/3),height/3+(height/3),0,20,'',None,"imgs/stage_placeholderbutton.png","imgs/stage_placeholderbutton_hover.png")
stage_placeholderbutton_6 = button(width/8+2*(width/3),height/3+(height/3),0,20,'',None,"imgs/stage_placeholderbutton.png","imgs/stage_placeholderbutton_hover.png")
# notify_msg = button( width/2+50, height/2, 250, 100,"PRESS ENTER TO GO BACK TO MAIN MENU FOR NOW",(255, 0, 255), None, None)
overallScreen = CurrentScene()
levels_list = [stage_placeholderbutton_1 ,stage_placeholderbutton_2 ,stage_placeholderbutton_3 ,stage_placeholderbutton_4 ,stage_placeholderbutton_5 ,stage_placeholderbutton_6 ]
stageSelection_list = [quit_mainmenu_button]
# print(range(len(levels_list)))
def drawAmount(current_levels):
for x in range(0,6):
if x <= current_levels:
stageSelection_list.append(levels_list[x])
drawAmount(levels_to_draw-1)
# Draw buttons
pauseMenu = Scene(overallScreen.curr_screen, "imgs/pause_bg_light.png", [continue_button, restart_button, tutorial_button, pause_title, quit_button, audio_button, accessibility_button], True)
InGame = Scene(screen, "imgs/in_game.png", [])
mainMenu = Scene(screen, "imgs/start_bare.png", [start_button,quit_button,audio_button,accessibility_button])
stageSelection = Scene(screen, "imgs/stage_select.png", stageSelection_list)
deathMenu = Scene(overallScreen.curr_screen, "imgs/pause_bg.png", [restart_button, tutorial_button, death_title, quit_button, audio_button, accessibility_button], True)
winMenu = Scene(overallScreen.curr_screen, "imgs/pause_bg_light.png", [continue_button, restart_button, tutorial_button, win_title, quit_button, audio_button, accessibility_button], True)
tutorialMenu = pygame.image.load("./imgs/tutorial.png")
#--------------------------------------------------------
#Define Booleans for stage states
#--------------------------------------------------------
running = True #game run state
main_menu_music = True
#--------------------------------------------------------
# Main Game Loop
# - Clock tick needs to be contained here
# - Game state is controlled here44
#--------------------------------------------------------
while running:
timer = pygame.time.Clock()
timer.tick(60)
overallScreen.update()
if overallScreen.checkChange():
overallScreen.go_to_next_scene()
#-------------PAUSE MENU-------------
pygame.display.update()
#for finding location of button
# if event.key == pygame.K_RIGHT:
# xIMG = xIMG+1
# if event.key == pygame.K_LEFT:
# xIMG = xIMG-1
# if event.key == pygame.K_DOWN:
# yIMG = yIMG+1
# if event.key == pygame.K_UP:
# yIMG = yIMG-1
# if event.key == pygame.K_RETURN:
# print("x: " +str(xIMG) + " y: " +str(yIMG))
# if event.key == pygame.K_SPACE:
# # print("width: " + str(width/mouse[0]))
# # print("height: " + str(height/mouse[1]))
# print(pygame.mouse.get_pos())
# Fill the background with white
# if width/2 <= mouse[0] <= width/2+140 and height/2 <= mouse[1] <= height/2+40:
# pygame.draw.rect(screen,color_light,[width/2,height/2,140,40])
# else:
# pygame.draw.rect(screen,color_dark,[width/2,height/2,140,40])
# screen.blit(text , (width/2+50,height/2))
# Done! Time to quit.
pygame.quit()
sys.exit()