-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.py
52 lines (45 loc) · 1.27 KB
/
menu.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
#!/usr/bin/env python
# encoding: utf-8
"""
menu.py
Created by Daniel Yang on 2011-03-11.
Copyright (c) 2011 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import unittest
import pygame
class menu:
def __init__(self, stats):
self.running = True
self.s1 = stats[0]
if len(stats) > 1:
self.s2 = stats[1]
else:
self.s2 = None
def run(self):
screen = pygame.display.set_mode((400,400))
pygame.display.set_caption("pyKaruga")
background_color = pygame.Surface(screen.get_size()).convert()
background_color.fill((0,0,0))
while self.running:
screen.fill((0,0,0))
font2 = pygame.font.Font("destructobeambb_reg.otf", 36)
gg = font2.render("GAME OVER!", True, (255,255,255))
screen.blit(gg, (100,100))
screen.blit(self.s1, (0,200))
if self.s2:
screen.blit(self.s2, (200,200))
pygame.display.set_caption("GAME OVER!!")
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.running = False
if event.type == pygame.KEYDOWN and (event.key == pygame.K_ESCAPE or event.key == pygame.K_q):
self.running = False
pygame.display.flip()
pygame.quit()
if __name__ == '__main__':
#pygame.init()
#n = menu()
pass
#n.run()