-
Notifications
You must be signed in to change notification settings - Fork 0
/
papyrus.py
85 lines (54 loc) · 1.8 KB
/
papyrus.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
76
77
78
79
80
81
82
83
84
85
from pygame import *
from math import *
from random import *
init()
size = width, height = 1000,700
screen = display.set_mode(size)
WHITE=(255,255,255)
backPic=image.load("Pictures/combat/papyrusFight.jpg") #4000x500
heartPic=image.load("Pictures/heart.png")#29x31
X=0
Y=1
VY=2
BACKX=4
onGround=3
#X Y VY onGround BACKGROUND
heart1=[250,650,0,True, 0]
def papyrus():
myClock=time.Clock()
running=True
while running:
for evnt in event.get():
if evnt.type == QUIT:
return "exit"
screen.blit(backPic,(heart1[BACKX],0))
#screen.blit(heartPic,(guy[X],guy[Y]))
offset=250-heart1[X]
keys=key.get_pressed()
if heart1[BACKX] > -4700:
heart1[BACKX]-=10 #the background is what is moving
if keys[K_UP] and heart1[onGround]:#jumping only if ON GROUND
heart1[VY]=-15 #jupming power
heart1[onGround]=False
heart1[Y]+=heart1[VY]
if heart1[Y]>=650:
heart1[Y]=650 #set it on ground
heart1[VY]=0 #stop falling
heart1[onGround]=True
heart1[VY]+=0.7 #apply gravity
collideCenter = (int(heart1[X]) + 25, int(heart1[Y] + 25))
if screen.get_at(collideCenter) == WHITE:
print("ur ded")
if screen.get_at(collideCenter) == (128,255,255):
print("u win")
screen.blit(heartPic, (heart1[X], heart1[Y]))
myClock.tick(60)
if key.get_pressed()[27]:
running=False
display.flip()
return "m"
page= "m"
while page!="exit":
if page == "m":
page = papyrus()
quit()