Commit 63831b2c by BellCodeEditor

save project

parent 0e88be29
Showing with 14 additions and 1 deletions
import pygame import pygame
from pygame import locals from pygame import locals
zb=400
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
...@@ -23,6 +23,19 @@ while True: ...@@ -23,6 +23,19 @@ while True:
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type=locals.KEYDOWN:
if event.key==locals.K_SPACE:
state="up"
if state=="up":
if y>150:
y-=5
else:
state="down"
if state == "down":
if y<400:
y+=5
else:
state="running"
wukong=hero[index] wukong=hero[index]
index+=1 index+=1
if index==5: if index==5:
......
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