Commit 138cddd7 by BellCodeEditor

auto save

parent be9a3d53
Showing with 6 additions and 4 deletions
......@@ -4,12 +4,14 @@ from random import*
pygame.init() # 初始化
class Block(pygame.sprite.Sprite):
def __init__(self,image1,imeage2,image3):
class Block(pygame.sprite.Sprite): # 障碍物精灵类
def __init__(self,image1,image2,image3):
super().__init__()
self.image = random.choice([image1,image2,image3])
# 加载障碍物的图片
self.image = random.choice([image1, image2, image3])
# 根据障碍物位图的宽高设置矩形
self.rect = self.image.get_rect()
# 障碍物绘制坐标
self.rect.x = 1000
self.rect.y = 500 - self.rect.height
# 创建一个窗口
......
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