Commit 5ead0f35 by BellCodeEditor

auto save

parent cd45bf18
Showing with 5 additions and 4 deletions
...@@ -4,14 +4,15 @@ import random ...@@ -4,14 +4,15 @@ import random
pygame.init() # 初始化 pygame.init() # 初始化
class Player(pygame.sprite.Sprite): class Block(pygame.sprite.Sprite):
def __init__(self,image): def __init__(self,image1,image2,image3):
super().__init__() super().__init__()
self.image = image self.image = random.choice([image1,image2,image3])
self.rect = self.image.get_rect() self.rect = self.image.get_rect()
self.rect.x = 150
self.rect.x = 1000
self.rect.y = 500 - self.rect.height self.rect.y = 500 - self.rect.height
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
......
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