Commit 9bb266ae by BellCodeEditor

save project

parent 0c06206a
Showing with 16 additions and 8 deletions
......@@ -31,8 +31,10 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
o=Block(stone,cacti,apple)
#o=Block(stone,cacti,apple)
block_list=pygame.sprite.Group()
time=0
index = 0
JumpSpeed= 30
jumpState = 'runing'
......@@ -41,14 +43,10 @@ background_x=0
word2=0
nub1=0
nub =0
gamebegin='go'
y = 400
while True:
if gamebegin=='stop':
break
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -109,10 +107,20 @@ while True:
scoreWord=word.render(info+str(word2),True,(255,255,255))
screen.blit(scoreWord, (730,10))
if o.rect.x <= 0-o.rect.width:
time+=1
if time==50:
time=0
r=random.randint(0,100)
if r>40:
o=Block(stone,cacti,apple)
o.rect.x-=8
screen.blit(o.image,(o.rect.x,o.rect.y))
block_list.add(o)
for prop in block_list:
prop.rect.x-=8
screen.blit(prop.image,(prop.rect.x,prop.rect.y))
if prop.rect.x <= 0-prop.rect.width:
prop.kill()
#if rectNub >= 9 and rect1.x<600 and rect1.x>300 and i==2:
# if rect2.x <= 0-rect2.width and nub==2:
# o2=random.choice([stone,cacti,apple])
......
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