Commit 92662126 by BellCodeEditor

auto save

parent 7fdd198f
Showing with 15 additions and 18 deletions
......@@ -53,6 +53,10 @@ dw,s=150,0
time=0
PS=60
gametate=True
yy=0
yyy=8
clock=1
l=0
class Rsc(pygame.sprite.Sprite):
def __init__(self,im1,im2,im3):
......@@ -74,8 +78,8 @@ blist=pygame.sprite.Group()
while True:
wukong=heros(hero[index])
print(G)
time+=1
print(clock)
time+=0.5*clock
if time>=60:
a=randint(1,60)
if a>=20:
......@@ -103,13 +107,6 @@ while True:
if IM!='running' and I_M>=1:
if event.key == locals.K_w:
IM='dup'
I_M=0
G+=2
if index<=4:
index+=1
if index==5:
index=1
dws=150,y
if gametate==True:
if IM=='up':
y-=G
......@@ -118,7 +115,8 @@ while True:
if G<= -42:
IM='running'
G=40
if IM=='dup':
wukong.rect.y=75
# if IM=='down':
# if G==0:
# y+=G
......@@ -136,11 +134,11 @@ while True:
herorun=hero[index]
# 将背景图画上去
bg_x-=1
bg_x-=(2+0.25*clock)
if bg_x<=-1000:
bg_x=0
screen.blit(bg, (bg_x, 0))
rond_x-=8
rond_x-=(8+0.5*clock)
if rond_x<= -1000:
rond_x=0
screen.blit(road, (rond_x, 500))
......@@ -148,16 +146,15 @@ while True:
# if obg.rect.x<0-obg.rect.height:
# obg=Rsc(stone,cacti,apple)
for pop in blist:
pop.rect.x-=8
pop.rect.x-=(8+clock)
screen.blit(pop.image,(pop.rect.x,pop.rect.y))
if pygame.sprite.collide_rect(wukong,pop):
screen.blit(go,(400,200))
gametate=False
for event in pygame.event.get():
if event.type == locals.KEYDOWN:
if event.key==locals.K_r:
gametate=True
pygame.sprite.kill(pop)
else:
if (pop.rect.x+pop.rect.y)<wukong.rect.x-wukong.rect.height:
clock+=0.1
# 刷新画面
pygame.display.update()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment