Commit d3f6ef69 by BellCodeEditor

save project

parent dec90555
Showing with 8 additions and 1 deletions
......@@ -3,10 +3,16 @@ from pygame import locals
import random
t=30
pygame.init() # 初始化
class Block(pygame.sprite.Sprite):
def__init__(self,image1,image2,image3):
super()._init_()
self.image=random.choice([image1,image2,image3])
self.x=1000
self.rect.y=500-self.rect.height
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
pygame.display.set_caption("啊对对对")
pygame.display.set_caption("wk")
# 载入图片
background = pygame.image.load('bg.png') # 背景
road = pygame.image.load('road.png') # 路
......@@ -67,6 +73,7 @@ while True:
if road_x<=-1000:
road_x=0
bg_x-=10
#if obstacle.rect.x<=0-obstacle.rect.width
# 将背景图画上去
screen.blit(background, (bg_x, 0))
screen.blit(road, (road_x, 500))
......
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