Commit 17edc4f6 by BellCodeEditor

auto save

parent 7fe7ad33
Showing with 6 additions and 8 deletions
import pygame x'x'x'x'x'xxxxxxximport pygame
from pygame import locals from pygame import locals
import random import random
pygame.init() # 初始化 pygame.init() # 初始化
class Block(pygame,sprite,Sprite): class Block(pygame,sprite,Sprite):
def_init_(self,imaga1,imaga2,imaga3): def_init_(self,imaga1,imaga2,imaga3):
supere()._init_() supere()._init_()s's's's's's's's's's's's's's's's's's's
self.image = random.choice([image1,image2,image3]) self.image = random.choice([image1,image2,image3])
self.rect = self.imef.image.get_rect() self.rect = self.imef.image.get_rect()
self.rect.x= 1000 self.rect.x= 1000
self.rect.y =500 - self.rect.height self.rect.y =500 - self.rect.heightssssssssssssssssssssssss's's's's's's's's's's's's's's's's's's
class Player(pygame,sprite,Sprite): class Player(pygame,sprite,Sprite):
def_init_(self,image): def_init_(self,image):
super()._init_() super()._init_()ssss's's's's's's's's's's's's's's's's'ssss's's'ssssss's's's's's's's's's'ssssss's's's's's's'ss's's's's's's's's's's's's's's's's's's's's's's's'ssssssssssssssssssssssssssssssss's's's's's's's's's's's's's's's's's'ssssss
self.image = image self.image = image
self.rect = self.imef.image.get_rect() self.rect = self.imef.image.get_rec.x = 150sssssssssssssssssssssss
self.rect.x = 150
self.rect.y = 400
def (self, parameter_list): def (self, parameter_list):
raise NotImplementedError raise NotImplementedError
...@@ -92,7 +90,7 @@ while True: ...@@ -92,7 +90,7 @@ while True:
# 创建障碍物对象 # 创建障碍物对象
time += 1 time += 1
if time >= 60: if time >= 60:
r=randon.randint(0,100) r=randon.randint(0,100)x'x'x'x'x'xxxxxxx
if r>40: if r>40:
obstacle = Block(bush,cacti,stome) obstacle = Block(bush,cacti,stome)
block_list.add(obstacle) block_list.add(obstacle)
......
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