-
Notifications
You must be signed in to change notification settings - Fork 4
/
theory_game3.py
58 lines (53 loc) · 1.67 KB
/
theory_game3.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
import pygame
import sys
import inputbox
from Button import Button
import errorScreen
from pygame.locals import *
def theory_game3(DISPLAYSURF):
if pygame.mixer.music.get_busy():
pygame.mixer.music.stop()
btn_back = pygame.image.load('Images/buttons/back.png')
btn_next = pygame.image.load('Images/buttons/next.png')
btn_home = pygame.image.load('Images/buttons/home.png')
clock = pygame.time.Clock()
background1=pygame.image.load('Images/game3/g3_1.png')
run = True
image_no = 1
while run:
mouse = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
sys.exit()
elif event.type == pygame.MOUSEBUTTONDOWN:
if rect_back.collidepoint(mouse):
if image_no <= 1:
image_no=1
else :
image_no-=1
image_name = "Images/game3/g3_"+str(image_no)+".png"
background1=pygame.image.load(image_name)
DISPLAYSURF.blit(background1,(0,0))
pygame.display.update()
elif rect_next.collidepoint(mouse):
if image_no >=6:
image_no =6
else :
image_no+=1
image_name = "Images/game3/g3_"+str(image_no)+".png"
background1=pygame.image.load(image_name)
DISPLAYSURF.blit(background1,(0,0))
pygame.display.update()
elif rect_home.collidepoint(mouse):
run = False
DISPLAYSURF.blit(background1,(0,0))
rect_back = DISPLAYSURF.blit(btn_back ,(10,10))
rect_next = DISPLAYSURF.blit(btn_next,(50,10))
rect_home= DISPLAYSURF.blit(btn_home,(550,10))
pygame.display.update()
clock.tick(60)
background_end=pygame.image.load('Images/simphy.jpg')
DISPLAYSURF.blit(background_end,(0,0))
pygame.display.update()