Commit 826de6e4 by BellCodeEditor

auto save

parent 184a06da
Showing with 3 additions and 7 deletions
...@@ -40,8 +40,8 @@ hero = [pygame.image.load('hero1.png'), ...@@ -40,8 +40,8 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'), pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
my.font=pygame.font.Font("") #my.font=pygame.font.Font("STKAITI.TTF")
score_
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "runing"
...@@ -69,7 +69,6 @@ while True: ...@@ -69,7 +69,6 @@ while True:
if jumpState == "runing": if jumpState == "runing":
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
speed=8//
# 悟空造型 # 悟空造型
wukong = Player(hero[index]) wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
...@@ -137,10 +136,7 @@ while True: ...@@ -137,10 +136,7 @@ while True:
with open("record.txt","w",encoding="utf-8") as file: with open("record.txt","w",encoding="utf-8") as file:
file.write(record) file.write(record)
else:
if sprite.rect.x+sprite.rect.width<wukong.rect.x:
score+=sprite.score
sprite.score=0
if score>old.score: if score>old.score:
score_sound.play() score_sound.play()
......
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