Commit 5e2dd2c6 by BellCodeEditor

save project

parent 2bad448c
Showing with 8 additions and 0 deletions
...@@ -2,6 +2,14 @@ import pygame ...@@ -2,6 +2,14 @@ import pygame
from pygame import locals from pygame import locals
import random import random
pygame.init() # 初始化 pygame.init() # 初始化
class Block(pygame.sprite.Sprite):
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)) screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() FPS = pygame.time.Clock()
......
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