Commit 12bb14a3 by BellCodeEditor

save project

parent f91ad548
Showing with 8 additions and 2 deletions
......@@ -3,6 +3,13 @@ from pygame import locals
import random
pygame.init() # 初始化
class Sb(pygame.sprite.Sprite):
def_init_(self,image1,image2,image3)
super()._init_()
self.image=random.choice([image1,image2,image3])
self.rect=self.image.get_rect()
rect.x = 1000
rect.y = 500 - rect.height
# 创建一个窗口
screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
......@@ -24,8 +31,7 @@ jumpState = "runing"
t = 30
obstacle = random.choice([bush, stone, cacti])
rect = obstacle.get_rect()
rect.x = 1000
rect.y = 500 - rect.height
while True:
for event in pygame.event.get():
......
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