Commit 03da3a44 by BellCodeEditor

save project

parent 6842e7e6
Showing with 7 additions and 7 deletions
......@@ -5,16 +5,12 @@ import random
pygame.init() # 初始化
class Ws(pygame.sprite.Sprite):
der _init_(self,image1,image2,image3):
def _init_(self,image1,image2,image3):
super()._init_()
self.image = random.choice([image1, image2, image3])
self.rect = self.image.get_rect()
self.rect.x = 1000
self.rect.y = 500-self.rect.height
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
......@@ -88,6 +84,10 @@ while True:
screen.blit(road, (0, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空
if rect.x <= 0-rect.width: # 障碍物消失
# 创建障碍物对象
obstacle = random.choice([bush,stone,cacti])
......
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