Commit eb0aa42d by BellCodeEditor

save project

parent 19f79676
Showing with 7 additions and 0 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import random
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
...@@ -21,7 +22,13 @@ index = 0 ...@@ -21,7 +22,13 @@ index = 0
jumpstate = "runing" jumpstate = "runing"
y=400 y=400
t=30 t=30
while True: while True:
if rect.x < 0-rect.width:
obstacle = choice([bush,stone,cacti])
rect = obstacle.get_rect()
rect.x = 1000
rect.y 500 - rect.height
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
......
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