Commit bc84c8c1 by BellCodeEditor

save project

parent 6891f36a
Showing with 32 additions and 4 deletions
if score>one:
\ No newline at end of file
......@@ -113,7 +113,19 @@ while True:
index=0
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
if score>three:
if score >=one:
text['第一名']=score
text['第二名']=one
text['第三名']=two
elif score >=two:
text['第二名']=score
text['第三名']=two
else:
text['第三名']=three
text=json.dumps(text,ensure_ascii=False)
with open('record.txt','w',encoding='utf-8') as f:
cont=f.write()
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
......@@ -135,7 +147,7 @@ while True:
p+=10
if event.key == locals.K_o:
p-=10
if event.key == locals.K_u:
if event.key == locals.K_u or event.key == locals.K_y:
for i in range(4):
obg=Rsc(stone,cacti,apple)
blist.add(obg)
......@@ -191,6 +203,19 @@ while True:
else:
screen.blit(go,(400,200))
gametate=False
if score>three:
if score>one:
text['第一名']=score
text['第二名']=one
text['第三名']=two
elif score>two:
text['第二名']=score
text['第三名']=two
else:
text['第三名']=three
text=json.dumps(text,ensure_ascii=False)
with open('record.txt','w',encoding='utf-8') as f:
cont=f.write()
else:
if (pop.rect.x+pop.rect.width)<=wukong.rect.x:
score+=pop.score
......
{"第1名": 0, "第2名": 0, "第3名": 0}
\ No newline at end of file
{"第1名": 902, "第2名": 0, "第3名": 0}
\ No newline at end of file
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