-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenu.py
More file actions
19 lines (17 loc) · 1009 Bytes
/
MainMenu.py
File metadata and controls
19 lines (17 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pygame
from Button import Button
from ScreenMixin import ScreenMixin
from Constants import screen_width,screen_height
from PregameScreenMultiplayer import PregameScreenMutliplayer
from PregameScreenSingleplayer import PregameScreenSingleplayer
from AddQuestionScreen import AddQuestionScreen
WHITE = (255, 255, 255)
class MainMenu(ScreenMixin):
def __init__(self,player):
super().__init__()
self.singleplayer = Button(screen_width//2-100,screen_height//2-50,200,50,"Singleplayer",lambda : PregameScreenSingleplayer(self.player))
multiplayer = Button(screen_width//2-100,screen_height//2+25,200,50,"Multiplayer",lambda : PregameScreenMutliplayer())
add_quesiton = Button(screen_width//2-100,screen_height//2+100,200,50,"Add question",lambda : AddQuestionScreen())
exit = Button(screen_width//2-100,screen_height//2+175,200,50,"Exit",lambda: pygame.quit())
self.buttons = [self.singleplayer,multiplayer,add_quesiton,exit]
self.player = player