Commit eec05ef8 by BellCodeEditor

save project

parent 04d735ac
Showing with 10 additions and 4 deletions
...@@ -18,9 +18,10 @@ hero = [pygame.image.load('hero1.png'), ...@@ -18,9 +18,10 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
index = 0 index = 0
x=1000
y=400 y=400
q=1 q=1
t=30 t=45
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -35,27 +36,31 @@ while True: ...@@ -35,27 +36,31 @@ while True:
if q == 2: if q == 2:
if t >= 0: if t >= 0:
y-=t y-=t
t-=5 t-=3
else: else:
q=3 q=3
if q == 3: if q == 3:
if t <= 30: if t <= 45:
y+=t y+=t
t+=5 t+=3
else: else:
q=1 q=1
y=400 y=400
a=hero[index] a=hero[index]
index += 1 index += 1
if index ==5: if index ==5:
index=0 index=0
x-=10
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(road, (0, 500)) screen.blit(road, (0, 500))
screen.blit(a, (150, y)) screen.blit(a, (150, y))
screen.blit(stone, (x, 400))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) 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