Commit 3ce357c3 by BellCodeEditor

save project

parent 6469b51e
Showing with 6 additions and 5 deletions
......@@ -2,13 +2,14 @@ import pygame
from pygame import locals
import random
pygame.init()
class Block(pygame.sprite.Sprite):
def __init__(self,image1,image2,image3):
def __init__(self,imaeg1,imaeg2,imaeg3):
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
self.rect = random.choice([imaeg1,imaeg2,imaeg3])
self.rect. = self.image.get_rect()
self.rect.x = 1000
self.rect.y = 500 - self.rect.heiht
pygame.init() # 初始化
# 创建一个窗口
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