-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStarterFile.py
More file actions
63 lines (42 loc) · 1.52 KB
/
Copy pathStarterFile.py
File metadata and controls
63 lines (42 loc) · 1.52 KB
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
import pygame
import button
#create display window
SCREEN_HEIGHT = 500
SCREEN_WIDTH = 800
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('DarkDays')
#load button images
start_img = pygame.image.load('NGameB.png').convert_alpha()
exit_img = pygame.image.load('EGameB.png').convert_alpha()
#create button instances
NewGame_button = button.Button(100, 200, start_img, 0.8)
exit_button = button.Button(150, 200, exit_img, 0.8)
def titleScreen():
image = pygame.image.load("TSLOVE.png")
image = pygame.transform.scale(image, (800,500))
run = True
while run:
if NewGame_button.draw(screen) == True:
print("RUN")
if exit_button.draw(screen) == True:
run = False
screen.blit(image, (0,0))
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.display.quit()
exit()
def game():
image = pygame.image.load("bg.png")
image = pygame.transform.scale(image, (640,480))
while True:
screen.blit(image, (0,0))
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.display.quit()
exit()
if event.type == pygame.KEYDOWN:
print("jump")
pygame.display.flip()
titleScreen()