Commit e630520a by BellCodeEditor

save project

parent 80d7cbc8
Showing with 8 additions and 4 deletions
......@@ -7,6 +7,7 @@ pygame.init() # 初始化
i=-1
y=400
tiao = 0
g = 30
screen = pygame.display.set_mode((1000, 600))
pygame.display.set_caption('wukongkupao')
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
......@@ -30,16 +31,19 @@ while True:
if event.key == locals.K_SPACE:
tiao = 1
if tiao == 1:
if y > 150:
y -= 10
if g >= 0:
y -= g
g -= 2
else:
tiao = 0
if tiao == 0:
if y < 400:
y += 10
if g <= 30:
y += g +2
g += 2
else:
tiao = 3
screen.blit(background, (0, 0))# 将背景图画上去
screen.blit(road, (0, 500))# 将背景图画上去
screen.blit(wukong,(150,y))#悟空的动作
......
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