Commit f16e5530 by BellCodeEditor

save project

parent 1dd4baea
Showing with 8 additions and 8 deletions
...@@ -23,8 +23,8 @@ class Player(pygame.sprite.Sprite): # 悟空 ...@@ -23,8 +23,8 @@ class Player(pygame.sprite.Sprite): # 悟空
self.image = image self.image = image
# image的get_rect()方法,可以返回pygame.Rect(0,0,图像宽,图像高)的对象 # image的get_rect()方法,可以返回pygame.Rect(0,0,图像宽,图像高)的对象
self.rect = self.image.get_rect() self.rect = self.image.get_rect()
self.rect.x = 150 self.rect.x = 1500
self.rect.y = 400 self.rect.y = 4000
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
...@@ -47,13 +47,13 @@ basic_font = pygame.font.Font('STKAITI.TTF', 18) # 字体 ...@@ -47,13 +47,13 @@ basic_font = pygame.font.Font('STKAITI.TTF', 18) # 字体
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "runing"
t = 35 t = 1200
road_x = 0 road_x = 0
bg_x = 0 bg_x = 0
time = 0 time = 0
gamestate = True gamestate = True
score = 0 score = 0
speed=8 speed=99999
old_score = score old_score = score
block_list = pygame.sprite.Group() # 创建精灵组 block_list = pygame.sprite.Group() # 创建精灵组
...@@ -85,13 +85,13 @@ while True: ...@@ -85,13 +85,13 @@ while True:
else: else:
jumpState = "down" jumpState = "down"
if jumpState == "down": # 降落状态 if jumpState == "down": # 降落状态
if t <= 35: if t <=1200 :
y += t y += t
wukong.rect.y = y wukong.rect.y = y
t += 2 t += 2
else: else:
jumpState = "runing" jumpState = "runing"
t = 35 t = 1200
# 将背景图画上去 # 将背景图画上去
bg_x -= 1 bg_x -= 1
...@@ -136,4 +136,4 @@ while True: ...@@ -136,4 +136,4 @@ while True:
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(1000)
\ No newline at end of file \ 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