Commit da7872b1 by BellCodeEditor

save project

parent 6c692a47
Showing with 12 additions and 4 deletions
......@@ -18,14 +18,22 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero5.png')]
index = 0
y = 400
jumpstate = 'runing'
pygame.display.set_caption('傻子悟空跑酷死了一百次HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH') #GAMENAME
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if y > 150:
y -= 5
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
jumpstate = 'up'
if jumpstate == 'up':
if y > 150:
y -= 5
else:
jumpstate = 'down'
wukong = hero[index]
index += 1
if index == 5:
......@@ -36,4 +44,4 @@ while True:
screen.blit(wukong, (150, y))
# 刷新画面
pygame.display.update()
FPS.tick(15)
\ No newline at end of file
FPS.tick(60)
\ 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