Commit 59728c78 by BellCodeEditor

save project

parent 21aecfcc
Showing with 8 additions and 5 deletions
import pygame
import pygame
from pygame import locals
import random
......@@ -51,7 +51,7 @@ bg_x = 0
time = 0
gamestate = True
score = 0
oid_score = score
old_score = score
block_list =pygame.sprite.Group() # 创建精灵组
while True:
for event in pygame.event.get():
......@@ -62,7 +62,7 @@ while True:
if jumpState == "runing":
if event.key == locals.K_SPACE:
jumpState = "up"
speed = 8 +score//3
# 悟空造型
wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下
......@@ -120,6 +120,9 @@ while True:
if (sprite.rect.x + sprite.rect.width) < wukong.rect.x:
score += sprite.score
sprite.score = 0
if score > old_score:
score_audio.play()
old_score = score
scoreSurf = basic_font.render("分数:"+str(score),True,(0,120,100))
screen.blit(scoreSurf,(880,20))
......
{"第1名": 0, "第2名": 0, "第3名": 0}
\ No newline at end of file
{"第1名": 5, "第2名": 4, "第3名": 2}
\ 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