-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
62 lines (45 loc) · 1.28 KB
/
main.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
#!/usr/bin/env python2
#
# Dinner with a Snowman
#
# Copyright (c) 2013, Iain R. Learmonth <irl@sdf.org>
# All rights reserved.
#
# For redistribution and use terms, see the LICENSE file.
#
import sys,pygame
from step import step
pygame.init()
width, height = size = (640, 480)
screen = pygame.display.set_mode(size)
try:
# Start Screen
start = pygame.image.load("assets/start.png")
screen.blit(start, start.get_rect())
pygame.display.flip()
waiting = True
while waiting:
for event in pygame.event.get():
if event.type == pygame.KEYUP:
if event.key == pygame.K_SPACE:
waiting = False
screen.fill((0, 0, 0))
pygame.display.flip()
state = 0
while state == 0:
state = step(screen)
pygame.time.delay(50)
pygame.time.delay(1000)
winImage = None
if state == 1:
winImage = pygame.image.load("assets/welldone.png")
if state > 1 and state < 4:
winImage = pygame.image.load("assets/tryharder.png")
if state >= 4:
winImage = pygame.image.load("assets/toodirty.png")
screen.blit(winImage, winImage.get_rect())
pygame.display.flip()
pygame.time.delay(10000)
except KeyboardInterrupt:
print
print "You told me to die so I'm dying now."