Commit 181d6acd by BellCodeEditor

save project

parent be97a4a6
Showing with 5 additions and 4 deletions
import pygame
from pygame import locals
import random
pygame.init() # 初始化
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
......@@ -23,6 +23,7 @@ wukong=hero[index]
jumpState='running'
y=400
i=30
obstacle=random.choice([])
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -39,18 +40,18 @@ while True:
wukong=hero[index]
if jumpState=='up':
if y>150:
if i>0:
y-=i
i-=2
else:
jumpState='down'
i=30
if jumpState=='down':
if y<400:
if i>0:
y+=i
i-=2
else:
jumpState=='running'
jumpState='running'
i=30
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
......
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