Commit 22cd3ea9 by BellCodeEditor

save project

parent 1d278a67
Showing with 12 additions and 2 deletions
import pygame
from pygame import locals
import random
pygame.init() # 初始化
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
......@@ -21,6 +21,10 @@ x = 0
a="running"
y = 400
t=30
s=random.choice([stone,cacti,apple])
rect = s.get_rect()
rect.x=500
rect.y=500-rect.height
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -42,7 +46,13 @@ while True:
else:
a="running"
t=30
# if rect.x<0-rect.width:
# s=random.choice([stone,cacti,apple])
# rect = s.get_rect()
# rect.x=1000
# rect.y=500-rect.height
rect.x-=10
screen.blit(s, (rect.x, rect.y))
wukong = hero[x]
if a=="running":
x+=1
......
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