Commit 3a221ad1 by BellCodeEditor

save project

parent 1f428d59
Showing with 10 additions and 5 deletions
import pygame import pygame
from pygame import locals from pygame import locals
t=30
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
...@@ -30,15 +30,20 @@ while True: ...@@ -30,15 +30,20 @@ while True:
if event.key== locals.K_SPACE: if event.key== locals.K_SPACE:
Jump='up' Jump='up'
if Jump=='up': if Jump=='up':
if y>150: if t>0:
y-=5 y-=t
t-=2
else: else:
Jump='down' Jump='down'
if Jump=='down': if Jump=='down':
if y<400: if t<=30:
y+=5 y+=t
t+=2
else: else:
Jump='running' Jump='running'
t=30
wukong = hero[i] wukong = hero[i]
i+=1 i+=1
if i>4: if i>4:
......
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