-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppltest.py
75 lines (68 loc) · 2.31 KB
/
ppltest.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,sys,random,pygame
def rn(max):
n=random.randint(1,max)
n=("0"*(3-len(str(n))))+str(n)
return n
def ri(f):
return f+random.choice(os.listdir(f))
def main():
# initialize the pygame module
pygame.init()
# load and set the logo
logo = pygame.image.load("logo.png")
pygame.display.set_icon(logo)
pygame.display.set_caption("VaporSchool")
# create a surface on screen that has the size of 240 x 180
screen = pygame.display.set_mode((150,150))
screen.fill((255,255,140))
image=pygame.image.load(ri("texture/bodylittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/facelittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/eyelittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/hairlittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/mouthlittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/pants/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/shoe/"))
screen.blit(image, (0,0))
pygame.display.flip()
#pygame.mixer.music.load("music/shootingstarsmidi.mid")
#pygame.mixer.music.play()
# define a variable to control the main loop
running = True
# main loop
while running:
pygame.time.wait(300)
screen.fill((255,255,140))
image=pygame.image.load(ri("texture/bodylittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/facelittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/eyelittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/hairlittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/mouthlittle/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/pants/"))
screen.blit(image, (0,0))
image=pygame.image.load(ri("texture/shoe/"))
screen.blit(image, (0,0))
pygame.display.flip()
# event handling, gets all event from the event queue
for event in pygame.event.get():
# only do something if the event is of type QUIT
if event.type == pygame.QUIT:
# change the value to False, to exit the main loop
running = False
# run the main function only if this module is executed as the main script
# (if you import this as a module then nothing is executed)
if __name__=="__main__":
# call the main function
main()