Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #By Mr.A a.k.a A-MAN
- #
- #All rights for this code are reserved for the only creator.
- #
- #No part of this code can be ediited or changed by any other coder except with permision.
- #
- #CopyRights 2011-2012 by Mr.A
- import pygame, sys, random
- import levels
- from pygame.locals import *
- from time import *
- GAMENAME = 'A-MaYheM'
- WINDOWWIDTH = 600
- WINDOWHEIGHT = 600
- PLAYERSPEED = 9
- BACKCOLOR = (0, 0, 0)
- FPS = 200
- carspeed = 100
- MOUSEAPPEAR = True
- pygame.init()
- pygame.mixer.init()
- pygame.mixer.pre_init(22050, -16, 4, 4096)
- music = ['1.ogg', '2.ogg' , '3.ogg']
- pygame.mixer.music.load(music[0])
- movedirx = 0
- movediry = 0
- passmen = True
- black = (0, 0, 0)
- Clock = pygame.time.Clock()
- pygame.display.set_caption(GAMENAME)
- windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT), 0, 32)
- crypo= 74
- pause = 1
- t2colpi = True
- basicfont = pygame.font.SysFont(None, 50)
- energyfont = pygame.font.SysFont(None, 35)
- stagefont = pygame.font.SysFont(None, 80)
- passfont = pygame.font.SysFont(None, 40)
- wrongpassfont = pygame.font.SysFont(None, 20)
- threetwoone = pygame.font.SysFont(None, 110)
- gosys = pygame.font.SysFont(None, 200)
- scorefont = pygame.font.SysFont(None, 35)
- carxop = False
- passyfile = open('passy.roc', 'r')
- passytext = passyfile.read()
- if passytext != "omar":
- p0= pygame.image.load('mycar0.bmp').convert()
- p0b= p0.get_rect()
- p1= pygame.image.load('mycar1.bmp').convert()
- p1b= p1.get_rect()
- p2= pygame.image.load('mycar2.bmp').convert()
- p2b= p2.get_rect()
- p= pygame.image.load('mycar.bmp').convert()
- pb= p.get_rect()
- else:
- carxop = True
- if carxop:
- p0= pygame.image.load('carx0.bmp').convert()
- p0b= p0.get_rect()
- p1= pygame.image.load('carx1.bmp').convert()
- p1b= p1.get_rect()
- p2= pygame.image.load('carx2.bmp').convert()
- p2b= p2.get_rect()
- p= pygame.image.load('carx.bmp').convert()
- pb= p.get_rect()
- passyfile.close
- if carxop:
- PLAYERSPEED = 15
- t3isthere = False
- t5isthere = False
- fx= random.randint(70, 630)
- windowSurface.fill(black)
- pygame.display.update()
- credit= pygame.image.load('cred.bmp').convert()
- creditb = credit.get_rect()
- creditb.center = windowSurface.get_rect().center
- windowSurface.blit(credit, creditb)
- pygame.display.update()
- sleep(3)
- #_______________trackssp_________:
- track1= pygame.image.load('track1.bmp').convert()
- track1b= track1.get_rect()
- t1bordr = pygame.image.load('t1border.bmp').convert()
- t1bordrb= t1bordr.get_rect()
- t1bordrb.centery = windowSurface.get_rect().centery
- t1bordrb.right = windowSurface.get_rect().width
- t1bordl = pygame.image.load('t1border.bmp').convert()
- t1bordlb = t1bordl.get_rect()
- t1bordlb.centery = windowSurface.get_rect().centery
- t1bordlb.left = 0
- t2bordr = pygame.image.load('t2border.bmp').convert()
- t2bordrb= t2bordr.get_rect()
- t2bordrb.centery = windowSurface.get_rect().centery
- t2bordrb.right = windowSurface.get_rect().width
- t2bordl = pygame.image.load('t2border.bmp').convert()
- t2bordlb = t2bordl.get_rect()
- t2bordlb.centery = windowSurface.get_rect().centery
- t2bordlb.left = 0
- track2= pygame.image.load('track2.bmp').convert()
- track2b= track2.get_rect()
- track2line= pygame.image.load('track2line.bmp').convert()
- track2lineb= track2line.get_rect()
- track2line2= pygame.image.load('track2line2.bmp').convert()
- track2line2b= track2line2.get_rect()
- track2line3= pygame.image.load('track2line3.bmp').convert()
- track2line3b= track2line3.get_rect()
- t2line2color = [track2line, track2line2, track2line3]
- track2lineb.bottom = windowSurface.get_rect().top
- track2lineb.centerx = windowSurface.get_rect().centerx - 175
- track2line2b.bottom = windowSurface.get_rect().top - 300
- track2line2b.centerx = windowSurface.get_rect().centerx + 175
- track2line3b.bottom = windowSurface.get_rect().top - 600
- track2line3b.centerx = windowSurface.get_rect().centerx
- track3= pygame.image.load('track3.bmp').convert()
- track3b= track3.get_rect()
- t3bordr = pygame.image.load('t3border.bmp').convert()
- t3bordrb= t3bordr.get_rect()
- t3bordrb.centery = windowSurface.get_rect().centery
- t3bordrb.right = windowSurface.get_rect().width
- t3bordl = pygame.image.load('t3border.bmp').convert()
- t3bordlb = t3bordl.get_rect()
- t3bordlb.centery = windowSurface.get_rect().centery
- t3bordlb.left = 0
- t3cov = pygame.image.load('track3_top.bmp').convert()
- t3ani = pygame.image.load('track3_ani.bmp').convert()
- t3anib1 = t3ani.get_rect()
- t3anib2 = t3ani.get_rect()
- t3anib1.centerx = windowSurface.get_rect().centerx
- t3anib1.bottom = windowSurface.get_rect().top - 600
- t3anib2.centerx = windowSurface.get_rect().centerx
- t3anib2.bottom = windowSurface.get_rect().top - 300
- track4= pygame.image.load('track4.bmp').convert()
- track4b= track4.get_rect()
- t4thundl1= pygame.image.load('thundr1.bmp').convert()
- t4thundl2= pygame.image.load('thundr2.bmp').convert()
- t4thundl3= pygame.image.load('thundr3.bmp').convert()
- t4thundr1= pygame.image.load('thundl1.bmp').convert()
- t4thundr2= pygame.image.load('thundl2.bmp').convert()
- t4thundr3= pygame.image.load('thundl3.bmp').convert()
- t4thundl1b= t4thundl1.get_rect()
- t4thundl2b= t4thundl2.get_rect()
- t4thundl3b= t4thundl3.get_rect()
- t4thundr1b= t4thundr1.get_rect()
- t4thundr2b= t4thundr2.get_rect()
- t4thundr3b= t4thundr3.get_rect()
- t4thundl1b.top = windowSurface.get_rect().top
- t4thundl1b.left = windowSurface.get_rect().left + 120
- t4thundr1b.right = windowSurface.get_rect().right - 120
- t4thundr1b.top = windowSurface.get_rect().top
- t4thundl2b.top = windowSurface.get_rect().top
- t4thundl2b.left = windowSurface.get_rect().left + 120
- t4thundr2b.right = windowSurface.get_rect().right - 120
- t4thundr2b.top = windowSurface.get_rect().top
- t4thundl3b.top = windowSurface.get_rect().top
- t4thundl3b.left = windowSurface.get_rect().left + 120
- t4thundr3b.right = windowSurface.get_rect().right - 120
- t4thundr3b.top = windowSurface.get_rect().top
- track5= pygame.image.load('track5.bmp').convert()
- track5b= track5.get_rect()
- t5bordr = pygame.image.load('t5border.bmp').convert()
- t5bordrb= t5bordr.get_rect()
- t5bordrb.centery = windowSurface.get_rect().centery
- t5bordrb.right = windowSurface.get_rect().width
- t5bordl = pygame.image.load('t5border.bmp').convert()
- t5bordlb = t5bordl.get_rect()
- t5bordlb.centery = windowSurface.get_rect().centery
- t5bordlb.left = 0
- t5flake1 = pygame.image.load('track5_flake1.bmp').convert()
- t5flake1b1 = t5flake1.get_rect()
- t5flake1b2 = t5flake1.get_rect()
- t5flake1b3 = t5flake1.get_rect()
- t5flake1b4 = t5flake1.get_rect()
- t5flake1b5 = t5flake1.get_rect()
- t5flake1b1.bottom= windowSurface.get_rect().top - 100
- t5flake1b2.bottom= windowSurface.get_rect().top - 250
- t5flake1b3.bottom= windowSurface.get_rect().top - 400
- t5flake1b4.bottom= windowSurface.get_rect().top - 550
- t5flake1b5.bottom= windowSurface.get_rect().top - 700
- t5flake1bteam= [t5flake1b1, t5flake1b2, t5flake1b3, t5flake1b4, t5flake1b5]
- t5flake1b1.centerx= windowSurface.get_rect().left + 530
- t5flake1b2.centerx= windowSurface.get_rect().left + 170
- t5flake1b3.centerx= windowSurface.get_rect().left + 430
- t5flake1b4.centerx= windowSurface.get_rect().left + 70
- t5flake1b5.centerx= windowSurface.get_rect().left + 280
- t5cov = pygame.image.load('t5top.bmp').convert()
- #_______________end_________:
- p0b.centerx = windowSurface.get_rect().centerx
- p0b.centery = windowSurface.get_rect().centery
- p1b.centerx = windowSurface.get_rect().centerx
- p1b.centery = windowSurface.get_rect().centery
- p2b.centerx = windowSurface.get_rect().centerx
- p2b.centery = windowSurface.get_rect().centery
- playerpics= [p0, p1, p2]*1200
- playerbodies= [p0b, p1b, p2b]*1200
- laser0= pygame.image.load('laserbeam.bmp').convert()
- laser1= pygame.image.load('laserbeamb.bmp').convert()
- claser0= pygame.image.load('claserbeam.bmp').convert()
- claser1= pygame.image.load('claserbeamb.bmp').convert()
- laser2= pygame.image.load('c1.bmp').convert()
- claser2= pygame.image.load('c2.bmp').convert()
- ESH1 = pygame.image.load('Esh1.bmp').convert()
- ESH2 = pygame.image.load('Esh2.bmp').convert()
- brick = pygame.image.load('lobstacle.bmp').convert()
- ibrick = pygame.image.load('iobstacle.bmp').convert()
- hbrick = pygame.image.load('hobstacle.bmp').convert()
- sbrick = pygame.image.load('obstacle.bmp').convert()
- rbrick = pygame.image.load('robstacle.bmp').convert()
- hp = pygame.image.load('hp.bmp').convert()
- ep = pygame.image.load('energy.bmp').convert()
- AZone = pygame.image.load('A-zone.bmp').convert()
- attacks = [laser0, laser1, claser0, claser1, laser2, claser2, ESH2, ESH1]
- Eshield= [ESH1, ESH2]
- laser0b = laser0.get_rect()
- laser1b = laser1.get_rect()
- claser0b = claser0.get_rect()
- claser1b = claser1.get_rect()
- laser2b = laser2.get_rect()
- claser2b = claser2.get_rect()
- ESHb = ESH1.get_rect()
- brickbody= brick.get_rect()
- ibrickbody= ibrick.get_rect()
- hbrickbody= hbrick.get_rect()
- sbrickbody = sbrick.get_rect()
- rbrickbody = rbrick.get_rect()
- hpbody = hp.get_rect()
- epbody = ep.get_rect()
- AZoneb = AZone.get_rect()
- AZoneb.centerx = windowSurface.get_rect().centerx
- AZoneb.centery = -25
- objects = [brick, ibrick, hbrick, sbrick, rbrick, AZone]
- #___________________explosions___________________:
- exp0 = pygame.image.load('exp0.bmp').convert()
- exp1 = pygame.image.load('exp1.bmp').convert()
- exp2 = pygame.image.load('exp2.bmp').convert()
- exp3 = pygame.image.load('exp3.bmp').convert()
- exp4 = pygame.image.load('exp4.bmp').convert()
- exp5 = pygame.image.load('exp5.bmp').convert()
- exp6 = pygame.image.load('exp6.bmp').convert()
- exp7 = pygame.image.load('exp7.bmp').convert()
- exp8 = pygame.image.load('exp8.bmp').convert()
- exp9 = pygame.image.load('exp9.bmp').convert()
- exp10 = pygame.image.load('exp10.bmp').convert()
- exp11 = pygame.image.load('exp11.bmp').convert()
- exb0 = exp0.get_rect()
- exb1 = exp1.get_rect()
- exb2 = exp2.get_rect()
- exb3 = exp3.get_rect()
- exb4 = exp4.get_rect()
- exb5 = exp5.get_rect()
- exb6 = exp6.get_rect()
- exb7 = exp7.get_rect()
- exb8 = exp8.get_rect()
- exb9 = exp9.get_rect()
- exb10 = exp10.get_rect()
- exb11 = exp11.get_rect()
- explosion= [exp0, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, exp9, exp10, exp11]
- explosionb= [exb0, exb1, exb2, exb3, exb4, exb5, exb6, exb7, exb8, exb9, exb10, exb11]
- bexp0 = pygame.image.load('bexp0.bmp').convert()
- bexp1 = pygame.image.load('bexp1.bmp').convert()
- bexp2 = pygame.image.load('bexp2.bmp').convert()
- bexp3 = pygame.image.load('bexp3.bmp').convert()
- bexp4 = pygame.image.load('bexp4.bmp').convert()
- bexp5 = pygame.image.load('bexp5.bmp').convert()
- bexp6 = pygame.image.load('bexp6.bmp').convert()
- bexp7 = pygame.image.load('bexp7.bmp').convert()
- bexp8 = pygame.image.load('bexp8.bmp').convert()
- bexp9 = pygame.image.load('bexp9.bmp').convert()
- bigexplosion= [bexp0, bexp1, bexp2, bexp3, bexp4, bexp5, bexp6, bexp7, bexp8, bexp9]
- #end:
- energy = pygame.image.load('live.bmp').convert()
- energyb = energy.get_rect()
- #_____________bpad______________:
- bouncepadr = pygame.image.load('ruwa.bmp').convert()
- bouncepadrb= bouncepadr.get_rect()
- bouncepadrb.centery = windowSurface.get_rect().centery
- bouncepadrb.right = windowSurface.get_rect().width
- bouncepadl = pygame.image.load('ruwa.bmp').convert()
- bouncepadlb= bouncepadl.get_rect()
- bouncepadlb.centery = windowSurface.get_rect().centery
- bouncepadlb.left = 0
- #end:
- #_______passsysfilespreparation_________:
- num1 = pygame.image.load('1numb.bmp').convert()
- num2 = pygame.image.load('2numb.bmp').convert()
- num3 = pygame.image.load('3numb.bmp').convert()
- num4 = pygame.image.load('4numb.bmp').convert()
- num5 = pygame.image.load('5numb.bmp').convert()
- num6 = pygame.image.load('6numb.bmp').convert()
- num7 = pygame.image.load('7numb.bmp').convert()
- num8 = pygame.image.load('8numb.bmp').convert()
- num9 = pygame.image.load('9numb.bmp').convert()
- num0 = pygame.image.load('0numb.bmp').convert()
- numdel = pygame.image.load('delnumb.bmp').convert()
- numselection = pygame.image.load('pdnumb.bmp').convert()
- numpad = [num1, num2, num3, num4, num5, num6, num7, num8, num9, num0, numdel, numselection]
- num1bdy= num1.get_rect()
- num2bdy= num2.get_rect()
- num3bdy= num3.get_rect()
- num4bdy= num4.get_rect()
- num5bdy= num5.get_rect()
- num6bdy= num6.get_rect()
- num7bdy= num7.get_rect()
- num8bdy= num8.get_rect()
- num9bdy= num9.get_rect()
- num0bdy= num0.get_rect()
- numdelbdy= numdel.get_rect()
- numselectionbdy = numselection.get_rect()
- #end:
- #_______energy bar_________:
- eb1 = pygame.image.load('energy1.bmp').convert()
- eb2 = pygame.image.load('energy2.bmp').convert()
- eb3 = pygame.image.load('energy3.bmp').convert()
- eb4 = pygame.image.load('energy4.bmp').convert()
- eb5 = pygame.image.load('energy5.bmp').convert()
- eb6 = pygame.image.load('energy6.bmp').convert()
- eb7 = pygame.image.load('energy7.bmp').convert()
- eb8 = pygame.image.load('energy8.bmp').convert()
- eb9 = pygame.image.load('energy9.bmp').convert()
- eb10 = pygame.image.load('energy10.bmp').convert()
- eb11 = pygame.image.load('energy11.bmp').convert()
- eb12 = pygame.image.load('energy12.bmp').convert()
- eb13 = pygame.image.load('energy13.bmp').convert()
- eb14 = pygame.image.load('energy14.bmp').convert()
- eb15 = pygame.image.load('energy15.bmp').convert()
- eb16 = pygame.image.load('energy16.bmp').convert()
- eb17 = pygame.image.load('energy17.bmp').convert()
- eb18 = pygame.image.load('energy18.bmp').convert()
- eb19 = pygame.image.load('energy19.bmp').convert()
- eb20 = pygame.image.load('energy20.bmp').convert()
- eb21 = pygame.image.load('energy21.bmp').convert()
- eb22 = pygame.image.load('energy22.bmp').convert()
- eb23 = pygame.image.load('energy23.bmp').convert()
- eb24 = pygame.image.load('energy24.bmp').convert()
- eb25 = pygame.image.load('energy25.bmp').convert()
- eb26 = pygame.image.load('energy26.bmp').convert()
- eb27 = pygame.image.load('energy27.bmp').convert()
- eb28 = pygame.image.load('energy28.bmp').convert()
- eb29 = pygame.image.load('energy29.bmp').convert()
- eb30 = pygame.image.load('energy30.bmp').convert()
- eb31 = pygame.image.load('energy31.bmp').convert()
- eb32 = pygame.image.load('energy32.bmp').convert()
- eb33 = pygame.image.load('energy33.bmp').convert()
- eb34 = pygame.image.load('energy34.bmp').convert()
- eb35 = pygame.image.load('energy35.bmp').convert()
- eb36 = pygame.image.load('energy36.bmp').convert()
- ebt = [eb1, eb1, eb2, eb2, eb3, eb3, eb4, eb4, eb5, eb5, eb6, eb6, eb7, eb7, eb8, eb8, eb9, eb9, eb10, eb10, eb11, eb11, eb12, eb12, eb13, eb13, eb14, eb14, eb15, eb15, eb16, eb16, eb17, eb17, eb18, eb18, eb19, eb19, eb20, eb20, eb21, eb21, eb22, eb22, eb23, eb23, eb24, eb24, eb25, eb25, eb26, eb26, eb27, eb27, eb28, eb28, eb29, eb29, eb30, eb30, eb31, eb31, eb32, eb32, eb33, eb33, eb34, eb34, eb35, eb35, eb36, eb36]
- eb1b = eb1.get_rect()
- eb2b = eb2.get_rect()
- eb3b = eb3.get_rect()
- eb4b = eb4.get_rect()
- eb5b = eb5.get_rect()
- eb6b = eb6.get_rect()
- eb7b = eb7.get_rect()
- eb8b = eb8.get_rect()
- eb9b = eb9.get_rect()
- eb10b = eb10.get_rect()
- eb11b = eb11.get_rect()
- eb12b = eb12.get_rect()
- eb13b = eb13.get_rect()
- eb14b = eb14.get_rect()
- eb15b = eb15.get_rect()
- eb16b = eb16.get_rect()
- eb17b = eb17.get_rect()
- eb18b = eb18.get_rect()
- eb19b = eb19.get_rect()
- eb20b = eb20.get_rect()
- eb21b = eb21.get_rect()
- eb22b = eb22.get_rect()
- eb23b = eb23.get_rect()
- eb24b = eb24.get_rect()
- eb25b = eb25.get_rect()
- eb26b = eb26.get_rect()
- eb27b = eb27.get_rect()
- eb28b = eb28.get_rect()
- eb29b = eb29.get_rect()
- eb30b = eb30.get_rect()
- eb31b = eb31.get_rect()
- eb32b = eb32.get_rect()
- eb33b = eb33.get_rect()
- eb34b = eb34.get_rect()
- eb35b = eb35.get_rect()
- eb36b = eb36.get_rect()
- eb1b.top = windowSurface.get_rect().top + 15
- eb1b.left = windowSurface.get_rect().centerx + 90
- #end:
- def Close():
- pygame.quit()
- sys.exit()
- def Track1(track1, track1b):
- windowSurface.blit(track1, track1b)
- windowSurface.blit(t1bordl, t1bordlb)
- windowSurface.blit(t1bordr, t1bordrb)
- def Track2(track2, track1b):
- windowSurface.blit(track2, track1b)
- if t2colpi == True and stageiteration % 100 == 0:
- random.shuffle(t2line2color)
- windowSurface.blit(t2line2color[1], track2line3b)
- windowSurface.blit(t2line2color[2], track2line2b)
- windowSurface.blit(t2line2color[0], track2lineb)
- windowSurface.blit(t2bordl, t1bordlb)
- windowSurface.blit(t2bordr, t1bordrb)
- track2line2b.top += vehiclespeed
- track2lineb.top += vehiclespeed
- track2line3b.top += vehiclespeed
- if track2line2b.top > WINDOWHEIGHT:
- track2line2b.bottom = windowSurface.get_rect().top
- track2line2b.centerx = windowSurface.get_rect().centerx
- if track2lineb.top > WINDOWHEIGHT:
- track2lineb.bottom = windowSurface.get_rect().top
- track2lineb.centerx = windowSurface.get_rect().centerx - 175
- if track2line3b.top > WINDOWHEIGHT:
- track2line3b.bottom = windowSurface.get_rect().top
- track2line3b.centerx = windowSurface.get_rect().centerx + 175
- return track2line2b, track2lineb, track2line3b
- def Track3(track3, track1b):
- global t3isthere
- windowSurface.blit(track3, track1b)
- windowSurface.blit(t3bordl, t1bordlb)
- windowSurface.blit(t3bordr, t1bordrb)
- t3isthere = True
- def Track4(track4, track1b):
- global t4isthere
- windowSurface.blit(track4, track1b)
- t4isthere = True
- def Track5(track5, track1b, t5flake1bteam):
- global fx, t5isthere
- t5isthere = True
- windowSurface.blit(track5, track1b)
- windowSurface.blit(t1bordl, t1bordlb)
- windowSurface.blit(t1bordr, t1bordrb)
- windowSurface.blit(t5bordl, t5bordlb)
- windowSurface.blit(t5bordr, t5bordrb)
- if t5isthere:
- windowSurface.blit(t5flake1, t5flake1b1)
- windowSurface.blit(t5flake1, t5flake1b2)
- windowSurface.blit(t5flake1, t5flake1b3)
- windowSurface.blit(t5flake1, t5flake1b4)
- windowSurface.blit(t5flake1, t5flake1b5)
- for a in t5flake1bteam:
- if a.top > WINDOWHEIGHT:
- fx= random.randint(70, 530)
- fy = random.randint(200, 700)
- a.centerx= windowSurface.get_rect().left+ fx
- a.bottom= windowSurface.get_rect().top- fy
- t5flake1b1.top += 7
- t5flake1b2.top += 7
- t5flake1b3.top += 7
- t5flake1b4.top += 7
- t5flake1b5.top += 7
- def hsmenu():
- _score_ = ''
- scrtxtd= []
- scrtxte= []
- ASC_VAL= 0
- chkscrtxt = open('HighScores.man', 'r')
- scrtxteb= chkscrtxt.readlines()
- for a in range(len(scrtxteb)):
- scrtxte.append(scrtxteb[a].rstrip('\n'))
- for a in scrtxte:
- _score_ = ''
- for symb in a:
- ASC_VAL = ord(symb)
- ASC_VAL -= crypo
- if ASC_VAL > 126:
- ASC_VAL -= 94
- if ASC_VAL < 32:
- ASC_VAL += 94
- _score_ += chr(ASC_VAL)
- scrtxtd.append(_score_)
- textscore1 = basicfont.render('1st. '+ scrtxtd[0], True, (255, 0, 0), (0 , 0 , 0))
- textscore2 = basicfont.render('2nd. '+ scrtxtd[1], True, (0, 255, 0), (0 , 0 , 0))
- textscore3 = basicfont.render('3rd. '+ scrtxtd[2], True, (0, 0, 255), (0 , 0 , 0))
- textscore4 = basicfont.render('4th. '+ scrtxtd[3], True, (255, 128, 0), (0 , 0 , 0))
- textscore5 = basicfont.render('5th. '+ scrtxtd[4], True, (0, 255, 128), (0 , 0 , 0))
- textscore6 = basicfont.render('6th. '+ scrtxtd[5], True, (128, 0, 255), (0 , 0 , 0))
- textscore7 = basicfont.render('7th. '+ scrtxtd[6], True, (0, 255, 255), (0 , 0 , 0))
- textscore8 = basicfont.render('8th. '+ scrtxtd[7], True, (255, 255, 0), (0 , 0 , 0))
- textscore9 = basicfont.render('9th. '+ scrtxtd[8], True, (255, 0, 255), (0 , 0 , 0))
- textscore10 = basicfont.render('10th. '+ scrtxtd[9], True, (128, 128, 128), (0 , 0 , 0))
- texttopscore = basicfont.render('Top Scores', True, (255, 255, 255), (0 , 0 , 0))
- textscore1b = textscore1.get_rect()
- textscore2b = textscore2.get_rect()
- textscore3b = textscore3.get_rect()
- textscore4b = textscore4.get_rect()
- textscore5b = textscore5.get_rect()
- textscore6b = textscore6.get_rect()
- textscore7b = textscore7.get_rect()
- textscore8b = textscore8.get_rect()
- textscore9b = textscore9.get_rect()
- textscore10b = textscore10.get_rect()
- texttopscoreb = texttopscore.get_rect()
- textscore1b.left = windowSurface.get_rect().left +150
- textscore2b.left = windowSurface.get_rect().left +150
- textscore3b.left = windowSurface.get_rect().left +150
- textscore4b.left = windowSurface.get_rect().left +150
- textscore5b.left = windowSurface.get_rect().left +150
- textscore6b.left = windowSurface.get_rect().left +150
- textscore7b.left = windowSurface.get_rect().left +150
- textscore8b.left = windowSurface.get_rect().left +150
- textscore9b.left = windowSurface.get_rect().left +150
- textscore10b.left = windowSurface.get_rect().left +150
- texttopscoreb.centerx = windowSurface.get_rect().centerx
- textscore1b.centery = windowSurface.get_rect().top + 100
- textscore2b.centery = windowSurface.get_rect().top + 150
- textscore3b.centery = windowSurface.get_rect().top + 200
- textscore4b.centery = windowSurface.get_rect().top + 250
- textscore5b.centery = windowSurface.get_rect().top + 300
- textscore6b.centery = windowSurface.get_rect().top + 350
- textscore7b.centery = windowSurface.get_rect().top + 400
- textscore8b.centery = windowSurface.get_rect().top + 450
- textscore9b.centery = windowSurface.get_rect().top + 500
- textscore10b.centery = windowSurface.get_rect().top + 550
- texttopscoreb.centery = windowSurface.get_rect().top+ 50
- while True:
- windowSurface.fill(BACKCOLOR)
- windowSurface.blit(textscore1, textscore1b)
- windowSurface.blit(textscore2, textscore2b)
- windowSurface.blit(textscore3, textscore3b)
- windowSurface.blit(textscore4, textscore4b)
- windowSurface.blit(textscore5, textscore5b)
- windowSurface.blit(textscore6, textscore6b)
- windowSurface.blit(textscore7, textscore7b)
- windowSurface.blit(textscore8, textscore8b)
- windowSurface.blit(textscore9, textscore9b)
- windowSurface.blit(textscore10, textscore10b)
- windowSurface.blit(texttopscore, texttopscoreb)
- pygame.display.update()
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- def passmenu():
- password = []
- wrong = False
- Right = False
- hplace = 25
- while True:
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if hplace == 25:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- hplace = 575
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_SPACE:
- password.append(1)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 80:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(2)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 135:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(3)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 190:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(4)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 245:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(5)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 300:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(6)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 355:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(7)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 410:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(8)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 465:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(9)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 520:
- if event.type == KEYDOWN:
- if event.key == K_RIGHT:
- hplace += 55
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- password.append(0)
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- elif hplace == 575:
- if event.type == KEYDOWN:
- if event.key == K_LEFT:
- hplace -= 55
- if event.key == K_SPACE:
- if len(password) != 0:
- delthing = len(password) - 1
- password.remove(password[delthing])
- if event.key == K_RIGHT:
- hplace = 25
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if event.key == K_BACKSPACE:
- windowSurface.fill((0, 0, 0))
- return
- windowSurface.fill(BACKCOLOR)
- num1bdy.centerx= windowSurface.get_rect().left + 25
- num1bdy.centery= windowSurface.get_rect().centery+ 50
- num2bdy.centerx= windowSurface.get_rect().left + 80
- num2bdy.centery= windowSurface.get_rect().centery +50
- num3bdy.centerx= windowSurface.get_rect().left +135
- num3bdy.centery= windowSurface.get_rect().centery +50
- num4bdy.centerx= windowSurface.get_rect().left +190
- num4bdy.centery= windowSurface.get_rect().centery +50
- num5bdy.centerx= windowSurface.get_rect().left +245
- num5bdy.centery= windowSurface.get_rect().centery +50
- num6bdy.centerx= windowSurface.get_rect().left +300
- num6bdy.centery= windowSurface.get_rect().centery +50
- num7bdy.centerx= windowSurface.get_rect().left +355
- num7bdy.centery= windowSurface.get_rect().centery +50
- num8bdy.centerx= windowSurface.get_rect().left +410
- num8bdy.centery= windowSurface.get_rect().centery +50
- num9bdy.centerx= windowSurface.get_rect().left +465
- num9bdy.centery= windowSurface.get_rect().centery+50
- num0bdy.centerx= windowSurface.get_rect().left +520
- num0bdy.centery= windowSurface.get_rect().centery +50
- numdelbdy.centerx= windowSurface.get_rect().left +575
- numdelbdy.centery= windowSurface.get_rect().centery +50
- numselectionbdy.centerx= windowSurface.get_rect().left + hplace
- numselectionbdy.centery= windowSurface.get_rect().centery +50
- passwordw= str(password).replace('[', '')
- passwordw= str(passwordw).replace(',', ' ')
- passwordw= str(passwordw).replace(']', '')
- thepass = passfont.render(str(passwordw), True, (255, 0, 0), (0 , 0 , 0))
- thepassrect = thepass.get_rect()
- thepassrect.centerx= windowSurface.get_rect().centerx
- thepassrect.centery= windowSurface.get_rect().top + 100
- wrongpassmess = wrongpassfont.render('The password you entered is incorrect', True, (255, 0, 0), (0 , 0 , 0))
- rightpassmess = wrongpassfont.render('You Unlocked A-Machine Model A!', True, (255, 255, 0), (0 , 0 , 0))
- wrongpassmessrect = wrongpassmess.get_rect()
- wrongpassmessrect.centerx= windowSurface.get_rect().centerx
- wrongpassmessrect.centery= windowSurface.get_rect().top + 50
- windowSurface.blit(num1, num1bdy)
- windowSurface.blit(num2, num2bdy)
- windowSurface.blit(num3, num3bdy)
- windowSurface.blit(num4, num4bdy)
- windowSurface.blit(num5, num5bdy)
- windowSurface.blit(num6, num6bdy)
- windowSurface.blit(num7, num7bdy)
- windowSurface.blit(num8, num8bdy)
- windowSurface.blit(num9, num9bdy)
- windowSurface.blit(num0, num0bdy)
- windowSurface.blit(numdel, numdelbdy)
- windowSurface.blit(numselection, numselectionbdy)
- if len(password) == 6:
- windowSurface.blit(thepass, thepassrect)
- pygame.display.update()
- sleep(1)
- password = []
- print passwordw
- if passwordw == "3 5 8 8 5 3":
- Right = True
- wrong = False
- print "hey"
- if passwordw != "3 5 8 8 5 3":
- Right = False
- wrong = True
- if Right:
- windowSurface.blit(rightpassmess, wrongpassmessrect)
- passyfile = open('passy.roc', 'w')
- passyfile.write('omar')
- passyfile.close()
- if wrong:
- windowSurface.blit(wrongpassmess, wrongpassmessrect)
- windowSurface.blit(thepass, thepassrect)
- pygame.display.update()
- def menu():
- menupos= 1
- play = False
- while True:
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if menupos == 1:
- if event.type == KEYDOWN:
- if event.key == K_DOWN:
- menupos += 1
- if event.key == K_SPACE:
- play = True
- elif menupos == 2:
- if event.type == KEYDOWN:
- if event.key == K_UP:
- menupos -= 1
- if event.key == K_SPACE:
- hsmenu()
- if event.key == K_DOWN:
- menupos += 1
- elif menupos == 3:
- if event.type == KEYDOWN:
- if event.key == K_UP:
- menupos -= 1
- if event.key == K_SPACE:
- passmenu()
- if event.key == K_DOWN:
- menupos += 1
- elif menupos == 4:
- if event.type == KEYDOWN:
- if event.key == K_UP:
- menupos -= 1
- if event.key == K_SPACE:
- Close()
- if menupos == 1:
- textstart = basicfont.render('Start Game', True, (255, 0, 0), (0 , 0 , 0))
- else:
- textstart = basicfont.render('Start Game', True, (255, 255, 255), (0, 0 , 0))
- if menupos == 2:
- textoption = basicfont.render('High Scores', True, (255, 0, 0), (0 , 0 , 0))
- else:
- textoption = basicfont.render('High Scores', True, (255, 255, 255), (0, 0 , 0))
- if menupos == 3:
- textpass = basicfont.render('Password', True, (255, 0, 0), (0 , 0 , 0))
- else:
- textpass = basicfont.render('Password', True, (255, 255, 255), (0, 0 , 0))
- if menupos == 4:
- textexit = basicfont.render('Exit', True, (255, 0, 0), (0 , 0 , 0))
- else:
- textexit = basicfont.render('Exit', True, (255, 255, 255), (0, 0 , 0))
- textstrect = textstart.get_rect()
- textstrect.centerx= windowSurface.get_rect().centerx
- textstrect.centery= windowSurface.get_rect().centery - 60
- textoprect = textoption.get_rect()
- textoprect.centerx= windowSurface.get_rect().centerx
- textoprect.centery= windowSurface.get_rect().centery - 20
- textparect = textpass.get_rect()
- textparect.centerx= windowSurface.get_rect().centerx
- textparect.centery= windowSurface.get_rect().centery + 20
- textexrect = textexit.get_rect()
- textexrect.centerx= windowSurface.get_rect().centerx
- textexrect.centery= windowSurface.get_rect().centery + 60
- windowSurface.blit(textstart, textstrect)
- windowSurface.blit(textexit, textexrect)
- windowSurface.blit(textpass, textparect)
- windowSurface.blit(textoption, textoprect)
- pygame.display.update()
- if play == True:
- break
- def bounce():
- global dobounce
- dobounce = True
- windowSurface.blit(bouncepadr, bouncepadrb)
- windowSurface.blit(bouncepadl, bouncepadlb)
- pygame.mouse.set_visible(MOUSEAPPEAR)
- windowSurface.fill(BACKCOLOR)
- #________________setting colorkeys_________________:
- for a in playerpics:
- colorkey = a.get_at((0,0))
- a.set_colorkey(colorkey)
- for a in explosion:
- colorkey = a.get_at((0,0))
- a.set_colorkey(colorkey)
- for a in bigexplosion:
- colorkey = a.get_at((0,0))
- a.set_colorkey(colorkey)
- for a in attacks:
- colorkey = a.get_at((0,1))
- a.set_colorkey(colorkey)
- for a in objects:
- colorkey = a.get_at((0,0))
- a.set_colorkey(colorkey)
- for a in explosion:
- a.set_colorkey(black)
- energy.set_colorkey(black)
- bouncepadr.set_colorkey(black)
- bouncepadl.set_colorkey(black)
- t1bordl.set_colorkey(black)
- t1bordr.set_colorkey(black)
- t2bordl.set_colorkey(black)
- t2bordr.set_colorkey(black)
- t3bordl.set_colorkey(black)
- t3bordr.set_colorkey(black)
- t3ani.set_colorkey(black)
- t3cov.set_colorkey(black)
- t5bordl.set_colorkey(black)
- t5bordr.set_colorkey(black)
- t5flake1.set_colorkey(black)
- t5cov.set_colorkey(black)
- for a in numpad:
- a.set_colorkey(black)
- for a in ebt:
- a.set_colorkey(black)
- #setting end:
- def restartduegameoverhahaha():
- global level, score, bulletspeed, lives, vehiclespeed, choice, energyint, dobounce, Esheildtrue, AEsheildtrue, shieldtime1, shieldtime2, stageiteration, movedirx, st1brick, st2brick, st3brick, st4brick, st5brick
- st1brick= []
- st2brick= []
- st3brick= []
- st4brick= []
- st5brick= []
- score = 1500 * int(level)
- bulletspeed = 30
- lives = 20
- vehiclespeed = 10
- if carxop:
- lives = 30
- vehiclespeed = 14
- choice = True
- energyint = 71
- dobounce = False
- Esheildtrue = False
- AEsheildtrue = False
- shieldtime1 = 0
- shieldtime2 = 0
- stageiteration= 0
- movedirx = 0
- def _initialthings_():
- global score, las, lasb, moveright, moveleft, go, bulletspeed, notinlaser, level, st1brick, st2brick, st3brick
- return
- score = 0
- las = False
- lasb = False
- moveright = False
- moveleft = False
- go = False
- bulletspeed = 30
- notinlaser = True
- level = 1
- st1brick= []
- st2brick= []
- st3brick= []
- st4brick= []
- st5brick= []
- st1hp= []
- st1ep= []
- explosionplace= []
- iexplosionplace= []
- bigexplosionplace= []
- y = 0
- lives = 20
- vehiclespeed = 10
- if carxop:
- lives = 30
- vehiclespeed = 16
- gameover = False
- trackc= track1
- y= 0
- z= 0
- dashright = dashleft = False
- dasho = False
- dashspeed = 20
- stageiteration= 0
- choice = True
- energyint = 71
- ebt.reverse()
- dobounce = False
- lbouncevalue= 0
- rbouncevalue= 0
- bounceleft = False
- bounceright= False
- menu()
- laserover = True
- charge = False
- chargeiteration= 0
- cshot = False
- clas = False
- clasb = False
- cgo = False
- cspower = 0
- cnotinlaser = True
- t3isthere = False
- choiceh = 0
- choicee = 0
- hx = 0
- ex = 0
- t4isthere = False
- thunderloop = 1
- Esheildtrue = False
- AEsheildtrue = False
- shieldtime1 = 0
- shieldtime2 = 0
- reflection = False
- x= 0
- ActivateAzone = False
- sounds = []
- channelexp = pygame.mixer.Channel(1)
- channellas = pygame.mixer.Channel(3)
- while True :
- for n in range(3600):
- t3isthere = False
- t4isthere = False
- t5isthere = False
- dobounce = False
- if stageiteration == 2:
- laserover = False
- while pause == 0:
- #_______________________buttons_assignment_____________________:
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- if event.key == K_F1:
- pause = 1
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- Close()
- if gameover == False:
- if laserover == False:
- if event.key == K_SPACE:
- if energyint > 0:
- charge = True
- if gameover == False:
- if event.key == K_LEFT:
- if dashleft == False and dashright == False:
- moveleft = True
- if event.key == K_RIGHT:
- if dashleft == False and dashright == False:
- moveright = True
- if event.key == K_LCTRL:
- dasho = False
- if dasho == True:
- if event.key == K_LEFT:
- if dashleft == False and dashright != True:
- moveleft = moveright = False
- dashleft= True
- if event.key == K_RIGHT:
- if dashleft == False and dashleft != True:
- moveleft = moveright = False
- dashright = True
- if event.type == KEYUP:
- if event.key == K_DOWN and stageiteration > 1:
- Esheildtrue= False
- AEsheildtrue= False
- chargeiteration= 0
- if event.key == K_F1:
- pause= 0
- if gameover == False:
- if laserover == False:
- if notinlaser == True and energyint > 0 and cshot== False:
- if event.key == K_SPACE:
- las = pygame.mixer.Sound('4.wav')
- channellas.play(las)
- las = True
- go = False
- energyint -= 1
- charge= False
- chargeiteration= 0
- elif cshot == True and energyint > 1 and cnotinlaser == True:
- if event.key == K_UP and stageiteration > 1:
- AEsheildtrue = True
- else:
- AEsheildtrue = False
- if event.key == K_SPACE:
- las = pygame.mixer.Sound('4.wav')
- channellas.play(las)
- clas = True
- cgo = False
- energyint -= 2
- charge= False
- chargeiteration= 0
- cshot = False
- if event.key == K_LCTRL:
- dasho = False
- if event.key == K_LEFT:
- moveleft = False
- if event.key == K_RIGHT:
- moveright = False
- #__________end_______________:
- if playerbodies[n].left < 19:
- moveleft = False
- dashleft = False
- if playerbodies[n].right > WINDOWWIDTH - 19:
- moveright = False
- dashright= False
- if moveleft == True:
- movedirx = movedirx - PLAYERSPEED
- if moveright == True:
- movedirx = movedirx + PLAYERSPEED
- if bounceleft == True:
- movedirx = movedirx - lbouncevalue
- if bounceright == True:
- movedirx = movedirx + rbouncevalue
- if dashleft == True:
- movedirx = movedirx - dashspeed
- if dashright == True:
- movedirx = movedirx + dashspeed
- p0b.centerx = windowSurface.get_rect().centerx + movedirx
- p0b.centery = windowSurface.get_rect().height - 100
- p1b.centerx = windowSurface.get_rect().centerx + movedirx
- p1b.centery = windowSurface.get_rect().height - 100
- p2b.centerx = windowSurface.get_rect().centerx + movedirx
- p2b.centery = windowSurface.get_rect().height - 100
- windowSurface.fill(BACKCOLOR)
- track1b.center = windowSurface.get_rect().center
- if (level == 1 or level == 2):
- if level == 1 and stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[0])
- Track1(track1, track1b)
- trackc= track1
- if (level == 3 or level == 4):
- Track2(track2, track1b)
- trackc= track2
- if level == 3 and stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[1])
- if level == 4 and stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[1])
- if (level == 5 or level == 6):
- Track3(track3, track1b)
- trackc= track3
- if stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[1])
- if (level == 7 or level == 8):
- Track5(track5, track1b, t5flake1bteam)
- trackc= track5
- if level == 8 and stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[2])
- if level == 7 and stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[1])
- if (level == 9 or level == 10):
- Track4(track4, track1b)
- trackc= track4
- if level == 8 and stageiteration == 1:
- if stageiteration == 1 and pygame.mixer.music.get_busy():
- pygame.mixer.music.stop()
- pygame.mixer.music.load(music[2])
- if t4isthere == True:
- if thunderloop > 0 and thunderloop < 11:
- thunder1= t4thundl1
- thunder2= t4thundr1
- elif thunderloop > 10 and thunderloop < 21:
- thunder1= t4thundl2
- thunder2= t4thundr2
- elif thunderloop > 20 and thunderloop < 31:
- thunder1= t4thundl3
- thunder2= t4thundr3
- elif thunderloop > 30:
- if thunderloop %20 == 0:
- thunder1= t4thundr3
- thunder2= t4thundl3
- t4thundr3b.top += 48
- t4thundl3b.top += 48
- elif thunderloop %10 == 0:
- thunder1= t4thundl3
- thunder2= t4thundr3
- t4thundr3b.top += 48
- t4thundl3b.top += 48
- windowSurface.blit(thunder1, t4thundl3b)
- windowSurface.blit(thunder2, t4thundr3b)
- bounce()
- thunderloop += 1
- if t4thundr3b.top > WINDOWHEIGHT:
- t4thundr3b.bottom = 0
- thunderloop = 0
- if t4thundl3b.top > WINDOWHEIGHT:
- t4thundl3b.bottom = 0
- thunderloop = 0
- windowSurface.blit(playerpics[n], playerbodies[n])
- stageiteration, st1brick, st2brick, st3brick, st4brick, st5brick, st1hp, st1hp, x, level, lives, energyint, movedirx, st1ep =levels.levels_dat(windowSurface, brickbody, hbrickbody, sbrickbody, ibrickbody, rbrickbody, epbody, hpbody, stageiteration, st1brick, st2brick, st3brick, st4brick, st5brick, st1hp, x, level, lives, energyint, movedirx, st1ep, black,basicfont)
- if charge== True:
- laser0b.bottom = p2b.top
- laser0b.centerx = p2b.centerx
- laser2b.bottom = p2b.top -4
- laser2b.centerx = p2b.centerx
- claser0b.bottom = p2b.top
- claser0b.centerx = p2b.centerx
- claser2b.bottom = p2b.top -4
- claser2b.centerx = p2b.centerx
- if chargeiteration < 10:
- pass
- elif chargeiteration <= 36:
- if chargeiteration in [10, 11, 12, 16, 17, 18, 22, 23, 24, 28, 29, 30, 34, 35, 36]:
- windowSurface.blit(laser0, laser0b)
- elif chargeiteration in [13, 14, 15, 19, 20, 21, 25, 26, 27, 31, 32, 33]:
- windowSurface.blit(laser2, laser2b)
- elif chargeiteration > 36:
- if chargeiteration % 4 == 0 or chargeiteration % 5 == 0:
- windowSurface.blit(claser0, claser0b)
- else:
- windowSurface.blit(claser2, claser2b)
- cshot = True
- chargeiteration += 1
- if AEsheildtrue:
- Esheildtrue= True
- AEsheildtrue= False
- chargeiteration= 0
- if Esheildtrue and stageiteration == 1:
- Esheildtrue= False
- AEsheildtrue= False
- chargeiteration= 0
- if Esheildtrue:
- shieldtime2 = time()
- ESHb.centerx = p2b.centerx
- if n % 2== 0:
- ESHb.top = p2b.top - 2
- windowSurface.blit(Eshield[0], ESHb)
- else:
- ESHb.top = p2b.top
- windowSurface.blit(Eshield[1], ESHb)
- if shieldtime2- shieldtime1 > 1:
- energyint -= 2
- shieldtime1= time()
- if energyint <= 2:
- Esheildtrue= False
- if las == True and clas == False:
- laser0b.centerx = p2b.centerx
- laser0b.bottom = p2b.top
- windowSurface.blit(laser0, laser0b)
- las = False
- lasb = True
- elif clas == True :
- claser0b.centerx = p2b.centerx
- claser0b.bottom = p2b.top
- windowSurface.blit(claser0, claser0b)
- clas = False
- clasb = True
- if lasb == True and go == False:
- notinlaser = False
- laser1b.centerx = p2b.centerx
- laser1b.bottom = p2b.top - 10
- go = True
- elif clasb == True and cgo == False:
- cnotinlaser = False
- claser1b.centerx = p2b.centerx
- claser1b.bottom = p2b.top - 10
- cgo = True
- if lasb == True and go == True:
- laser1b.bottom -= bulletspeed
- windowSurface.blit(laser1, laser1b)
- elif clasb == True and cgo == True:
- claser1b.bottom -= bulletspeed
- windowSurface.blit(claser1, claser1b)
- for a in st1brick:
- windowSurface.blit(brick, a)
- if laser1b.colliderect(a):
- explosionplace.append(a)
- st1brick.remove(a)
- laser1b[1]= -35
- score += 200
- elif claser1b.colliderect(a):
- explosionplace.append(a)
- cspower += 1
- score += 200
- st1brick.remove(a)
- if cspower == 2:
- claser1b[1]= -10035
- cspower = 0
- if playerbodies[n].colliderect(a):
- explosionplace.append(a)
- st1brick.remove(a)
- if not Esheildtrue:
- lives -=1
- else:
- score += 10
- for a in st2brick:
- windowSurface.blit(ibrick, a)
- if laser1b.colliderect(a):
- iexplosionplace.append(a)
- laser1b[1]= -1000
- if claser1b.colliderect(a):
- iexplosionplace.append(a)
- cspower += 2
- if cspower > 1:
- claser1b[1]= -1035
- cspower = 0
- if playerbodies[n].colliderect(a):
- explosionplace.append(a)
- st2brick.remove(a)
- if not Esheildtrue:
- lives -=3
- else:
- score += 10
- lives -= 2
- for a in st3brick:
- windowSurface.blit(hbrick, a)
- if laser1b.colliderect(a):
- iexplosionplace.append(a)
- st1brick.append(a)
- st3brick.remove(a)
- laser1b[1]= -1000
- elif claser1b.colliderect(a):
- if cspower == 1:
- iexplosionplace.append(a)
- st1brick.append(a)
- st3brick.remove(a)
- cspower +=1
- score += 200
- elif cspower == 0:
- iexplosionplace.append(a)
- cspower += 2
- score += 400
- st3brick.remove(a)
- if cspower == 2:
- claser1b[1]= -1035
- cspower = 0
- if playerbodies[n].colliderect(a):
- iexplosionplace.append(a)
- if not Esheildtrue:
- lives -=2
- else:
- score += 10
- lives -= 1
- st3brick.remove(a)
- for a in st4brick:
- windowSurface.blit(sbrick, a)
- if laser1b.colliderect(a):
- explosionplace.append(a)
- st4brick.remove(a)
- laser1b[1]= -35
- score += 150
- elif claser1b.colliderect(a):
- explosionplace.append(a)
- st4brick.remove(a)
- cspower += 1
- score += 350
- if cspower == 2:
- claser1b[1]= -35
- cspower = 0
- if playerbodies[n].colliderect(a):
- explosionplace.append(a)
- st4brick.remove(a)
- if not Esheildtrue:
- lives -=1
- else:
- score += 10
- for a in st5brick:
- windowSurface.blit(rbrick, a)
- if laser1b.colliderect(a) or claser1b.colliderect(a):
- reflection = True
- elif claser1b.colliderect(a):
- reflection = True
- if playerbodies[n].colliderect(a):
- explosionplace.append(a)
- st5brick.remove(a)
- if not Esheildtrue:
- lives -=1
- else:
- score += 10
- for a in st1hp:
- windowSurface.blit(hp, a)
- if laser1b.colliderect(a):
- explosionplace.append(a)
- st1hp.remove(a)
- score += 1000
- laser1b[1]= -35
- if claser1b.colliderect(a):
- explosionplace.append(a)
- st1hp.remove(a)
- cspower += 1
- score += 1000
- if cspower == 2:
- claser1b[1]= -1035
- cspower = 0
- if playerbodies[n].colliderect(a):
- st1hp.remove(a)
- lives += 3
- for a in st1ep:
- windowSurface.blit(ep, a)
- if laser1b.colliderect(a):
- explosionplace.append(a)
- st1ep.remove(a)
- score += 1000
- laser1b[1]= -35
- if claser1b.colliderect(a):
- explosionplace.append(a)
- st1ep.remove(a)
- cspower += 1
- score += 1000
- if cspower == 2:
- claser1b[1]= -1035
- cspower = 0
- if playerbodies[n].colliderect(a):
- st1ep.remove(a)
- if energyint < 62:
- energyint += 10
- else:
- energyint = 71
- if playerbodies[n].colliderect(laser1b):
- explosionplace.append(playerbodies[n])
- laser1b.top = WINDOWHEIGHT +1000
- if not Esheildtrue:
- lives -=1
- else:
- score += 10
- if playerbodies[n].colliderect(claser1b):
- explosionplace.append(playerbodies[1])
- claser1b.top = WINDOWHEIGHT +1000
- cspower = 0
- if not Esheildtrue:
- lives -=2
- else:
- lives -=1
- if playerbodies[n].colliderect(bouncepadrb) and dobounce == True:
- bounceleft = True
- lbouncevalue= 30
- if playerbodies[n].colliderect(bouncepadlb) and dobounce == True:
- bounceright = True
- rbouncevalue= 30
- if bounceleft == True:
- if lbouncevalue > 0:
- lbouncevalue -= 1
- else:
- lbouncevalue= 0
- bounceleft = False
- if bounceright == True:
- if rbouncevalue > 0:
- rbouncevalue -= 1
- else:
- rbouncevalue= 0
- bounceright = False
- #A-zone activation
- if stageiteration == 2500:
- ActivateAzone = True
- if ActivateAzone == True:
- windowSurface.blit(AZone, AZoneb)
- AZoneb[1] = AZoneb[1] + vehiclespeed
- if AZoneb.top >= playerbodies[n].top:
- pygame.time.delay(250)
- vehiclespeed += 3
- PLAYERSPEED += 3
- AZoneb = AZone.get_rect()
- AZoneb.centerx = windowSurface.get_rect().centerx
- AZoneb.centery = -25
- ActivateAzone = False
- while lives < 1 :
- pygame.mixer.stop()
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- bulletspeed += 30
- vehiclespeed= 0
- windowSurface.fill(BACKCOLOR)
- gameover = True
- for a in st1brick:
- windowSurface.blit(brick, a)
- pygame.display.flip()
- for a in bigexplosion:
- windowSurface.fill(BACKCOLOR)
- windowSurface.blit(bigexplosion[z], playerbodies[n])
- z +=1
- exlsound = pygame.mixer.Sound('7.wav')
- exlsound.play()
- pygame.display.flip()
- if z == 10:
- while z == 10:
- windowSurface.fill(BACKCOLOR)
- for d in st1brick:
- windowSurface.blit(brick, d)
- pygame.display.flip()
- pygame.time.delay(20)
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- try:
- _score_ = ''
- scrtxtd= []
- scrtxte= []
- ASC_VAL= 0
- chkscrtxt = open('HighScores.man', 'r')
- scrtxteb= chkscrtxt.readlines()
- for c in range(len(scrtxteb)):
- scrtxte.append(scrtxteb[c].rstrip('\n'))
- for c in scrtxte:
- _score_ = ''
- for symb in c:
- ASC_VAL = ord(symb)
- ASC_VAL -= crypo
- if ASC_VAL > 126:
- ASC_VAL -= 94
- if ASC_VAL < 32:
- ASC_VAL += 94
- _score_ += chr(ASC_VAL)
- scrtxtd.append(_score_)
- chkscrtxt.close()
- _score_ = ''
- for sn in range(10):
- if score > int(scrtxtd[sn]):
- chkscrtxt = open('HighScores.man', 'w')
- for symb in str(score):
- ASC_VAL = ord(symb)
- ASC_VAL += crypo
- if ASC_VAL > 126:
- ASC_VAL -= 94
- if ASC_VAL < 32:
- ASC_VAL += 94
- _score_ += chr(ASC_VAL)
- scrtxteb[sn]= _score_ + '\n'
- chkscrtxt.writelines(scrtxteb)
- scrtxteb= []
- chkscrtxt.close()
- for c in range(256):
- windowSurface.fill(BACKCOLOR)
- gameoverfont = threetwoone.render('GAME OVER', True, (c, c, c), (0, 0 , 0))
- gameoverfontb= gameoverfont.get_rect()
- gameoverfontb.centery= windowSurface.get_rect().centery
- gameoverfontb.centerx= windowSurface.get_rect().centerx
- windowSurface.blit(gameoverfont, gameoverfontb)
- pygame.display.flip()
- pygame.time.delay(10)
- if c == 255:
- sleep(2)
- gameover = False
- restartduegameoverhahaha()
- z = 0
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- except:
- for c in range(256):
- windowSurface.fill(BACKCOLOR)
- gameoverfont = threetwoone.render('GAME OVER', True, (c, c, c), (0, 0 , 0))
- gameoverfontb= gameoverfont.get_rect()
- gameoverfontb.centery= windowSurface.get_rect().centery
- gameoverfontb.centerx= windowSurface.get_rect().centerx
- windowSurface.blit(gameoverfont, gameoverfontb)
- pygame.display.flip()
- pygame.time.delay(10)
- if c == 255:
- sleep(2)
- gameover = False
- restartduegameoverhahaha()
- z = 0
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- Clock.tick(30)
- for a in st1brick:
- if a[1] > WINDOWHEIGHT:
- st1brick.remove(a)
- for b in range(len(st1brick)):
- st1brick[b][1] = st1brick[b][1] + vehiclespeed
- for a in st4brick:
- if a[1] > WINDOWHEIGHT:
- st4brick.remove(a)
- for b in range(len(st4brick)):
- st4brick[b][1] = st4brick[b][1] + vehiclespeed
- for a in st2brick:
- if a[1] > WINDOWHEIGHT:
- st2brick.remove(a)
- for b in range(len(st2brick)):
- st2brick[b][1] = st2brick[b][1]+ vehiclespeed
- for a in st3brick:
- if a[1] > WINDOWHEIGHT:
- st3brick.remove(a)
- for b in range(len(st3brick)):
- st3brick[b][1] = st3brick[b][1] + vehiclespeed
- for a in st5brick:
- if a[1] > WINDOWHEIGHT:
- st5brick.remove(a)
- for b in range(len(st5brick)):
- st5brick[b][1] = st5brick[b][1] + vehiclespeed
- for a in st1hp:
- if a[1] > WINDOWHEIGHT:
- st1hp.remove(a)
- for b in range(len(st1hp)):
- st1hp[b][1] = st1hp[b][1] + vehiclespeed
- for a in st1ep:
- if a[1] > WINDOWHEIGHT:
- st1ep.remove(a)
- for b in range(len(st1ep)):
- st1ep[b][1] = st1ep[b][1] + vehiclespeed
- for q in explosionplace:
- exnsound = pygame.mixer.Sound('7.wav')
- windowSurface.blit(explosion[y], q)
- y += 1
- q[1]= q[1]+8
- if y == 12:
- y = 0
- explosionplace.remove(q)
- for q in iexplosionplace:
- exnsound = pygame.mixer.Sound('8.wav')
- windowSurface.blit(explosion[y], q)
- y += 1
- q[1]= q[1]
- if y == 12:
- y = 0
- iexplosionplace.remove(q)
- if claser1b.bottom < 0:
- claser1b[1] = -10000
- clas = False
- clasb = False
- cgo = False
- cnotinlaser= True
- cspower = 0
- if laser1b.bottom < 0:
- laser1b[1] = -10000
- las = False
- lasb = False
- go = False
- notinlaser= True
- if reflection:
- if laser1b.top > WINDOWHEIGHT :
- bulletspeed = 30
- las = False
- lasb = False
- go = False
- notinlaser= True
- reflection = False
- elif claser1b.top > WINDOWHEIGHT:
- bulletspeed = 30
- clas = False
- clasb = False
- cgo = False
- cnotinlaser= True
- cspower = 0
- reflection = False
- else:
- bulletspeed = -30
- if t5isthere:
- windowSurface.blit(t5cov, track1b)
- if t3isthere:
- windowSurface.blit(t3cov, track1b)
- windowSurface.blit(t3ani, t3anib1)
- windowSurface.blit(t3ani, t3anib2)
- t3anib1.top += vehiclespeed
- t3anib2.top += vehiclespeed
- if t3anib1.top > WINDOWHEIGHT:
- t3anib1.bottom = 0
- if t3anib2.top > WINDOWHEIGHT:
- t3anib2.bottom = 0
- if t3anib1.top > WINDOWHEIGHT:
- t3anib1.bottom = 0
- if t3anib2.top > WINDOWHEIGHT:
- t3anib2.bottom = 0
- textscore = scorefont.render(str(score), False, (255, 0, 0), (0 , 0 , 0))
- textscorest = scorefont.render('Score:', False, (255, 0, 0), (0 , 0 , 0))
- textener = basicfont.render(str(lives), False, (0, 200, 255), (0 , 0 , 0))
- textscrect = textscore.get_rect()
- textscstrect = textscorest.get_rect()
- textenerrect= textener.get_rect()
- textscrect.centerx= windowSurface.get_rect().centerx - 5
- textscstrect.centerx= windowSurface.get_rect().centerx - 115
- textscrect.centery= windowSurface.get_rect().top + 25
- textscstrect.centery= windowSurface.get_rect().top + 25
- textenerrect.centerx= windowSurface.get_rect().centerx - 200
- textenerrect.centery= windowSurface.get_rect().top + 25
- energyb.centerx= windowSurface.get_rect().centerx - 250
- energyb.centery= windowSurface.get_rect().top + 25
- textscore.set_colorkey(black)
- textscorest.set_colorkey(black)
- textener.set_colorkey(black)
- windowSurface.blit(textscore, textscrect)
- windowSurface.blit(textscorest, textscstrect)
- windowSurface.blit(textener, textenerrect)
- windowSurface.blit(energy, energyb)
- windowSurface.blit(ebt[energyint], eb1b)
- if level == 11:
- passcodeimg = pygame.image.load("passed.bmp")
- passcodeimgb= passcodeimg.get_rect()
- passcodeimgb.center = windowSurface.get_rect().center
- while True:
- windowSurface.blit(passcodeimg, passcodeimgb)
- for event in pygame.event.get():
- if event.type == QUIT:
- Close()
- if event.type == KEYUP:
- moveleft = moveright= False
- if event.key == K_ESCAPE:
- Close()
- pygame.display.update()
- #3-2-1 go
- if stageiteration == 2:
- pygame.mixer.music.stop()
- pygame.mixer.music.play(-1, 12.0)
- vehiclespeed = 10
- PLAYERSPEED = 9
- windowSurface.fill(BACKCOLOR)
- three = threetwoone.render('3', False, (255, 0, 0), (0, 0 , 0))
- threeb = three.get_rect()
- threeb.center = windowSurface.get_rect().center
- three.set_colorkey(black)
- p.set_colorkey(black)
- windowSurface.blit(trackc, track1b)
- windowSurface.blit(p, playerbodies[n])
- textscore.set_colorkey(black)
- textscorest.set_colorkey(black)
- textener.set_colorkey(black)
- windowSurface.blit(textscore, textscrect)
- windowSurface.blit(textscorest, textscstrect)
- windowSurface.blit(textener, textenerrect)
- windowSurface.blit(energy, energyb)
- windowSurface.blit(three, threeb)
- windowSurface.blit(ebt[energyint], eb1b)
- pygame.display.update()
- sleep(2)
- windowSurface.fill(BACKCOLOR)
- two = threetwoone.render('2', False, (0, 255, 0), (0, 0 , 0))
- two.set_colorkey(black)
- p.set_colorkey(black)
- windowSurface.blit(trackc, track1b)
- windowSurface.blit(p, playerbodies[n])
- textscore.set_colorkey(black)
- textscorest.set_colorkey(black)
- textener.set_colorkey(black)
- windowSurface.blit(textscore, textscrect)
- windowSurface.blit(textscorest, textscstrect)
- windowSurface.blit(textener, textenerrect)
- windowSurface.blit(energy, energyb)
- windowSurface.blit(two, threeb)
- windowSurface.blit(ebt[energyint], eb1b)
- pygame.display.update()
- sleep(2)
- windowSurface.fill(BACKCOLOR)
- one = threetwoone.render('1', False, (0, 0, 255), (0, 0 , 0))
- one.set_colorkey(black)
- p.set_colorkey(black)
- windowSurface.blit(trackc, track1b)
- windowSurface.blit(p, playerbodies[n])
- textscore.set_colorkey(black)
- textscorest.set_colorkey(black)
- textener.set_colorkey(black)
- windowSurface.blit(textscore, textscrect)
- windowSurface.blit(textscorest, textscstrect)
- windowSurface.blit(textener, textenerrect)
- windowSurface.blit(energy, energyb)
- windowSurface.blit(one, threeb)
- windowSurface.blit(ebt[energyint], eb1b)
- pygame.display.update()
- sleep(2)
- windowSurface.fill(BACKCOLOR)
- gowrite = gosys.render('GO!', False, (255, 255, 255), (0, 0 , 0))
- gowriteb= gowrite.get_rect()
- gowriteb.center = windowSurface.get_rect().center
- gowrite.set_colorkey(black)
- p.set_colorkey(black)
- windowSurface.blit(trackc, track1b)
- windowSurface.blit(p, playerbodies[n])
- textscore.set_colorkey(black)
- textscorest.set_colorkey(black)
- textener.set_colorkey(black)
- windowSurface.blit(textscore, textscrect)
- windowSurface.blit(textscorest, textscstrect)
- windowSurface.blit(textener, textenerrect)
- windowSurface.blit(energy, energyb)
- windowSurface.blit(gowrite, gowriteb)
- windowSurface.blit(ebt[energyint], eb1b)
- pygame.display.update()
- sleep(1)
- #3-2-1 go_end
- Clock.tick(carspeed)
- Clock.tick(FPS)
- score += 1
- dobounce = False
- pygame.display.update()
- #######################################################################################################
- #levels.py
- ######################################################################################################
- import pygame
- from pygame.locals import *
- from time import *
- def levels_dat(windowSurface, brickbody, hbrickbody
- , sbrickbody, ibrickbody, rbrickbody
- , epbody , hpbody, stageiteration
- , st1brick,st2brick,st3brick,st4brick
- , st5brick, st1hp , x , level , lives
- , energyint,movedirx,st1ep,black,basicfont):
- choiceh = None
- choicee = None
- choice1 = None
- choice2 = None
- choice3 = None
- choice4 = None
- choice5 = None
- hx = 0
- ex = 0
- #_______________________stage 1______________________
- stageiteration += 1
- if stageiteration == 2000:
- st1brick= []
- st2brick= []
- st3brick= []
- st4brick= []
- st5brick= []
- if stageiteration % 100 == 0 and level == 1 and stageiteration < 2001:
- if stageiteration in [100, 400, 700, 1000, 1300, 1700, 2000]:
- x = -55
- if stageiteration in [200, 500, 800, 1100, 1400, 1800]:
- x = -200
- if stageiteration in [300, 600, 900, 1200, 1500, 1900]:
- x = 90
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- hpbody.top = windowSurface.get_rect().top
- hpbody.centerx = windowSurface.get_rect().centerx + x
- hpb = list(hpbody)
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- st1brick.append(brickb)
- st1brick.append(brickb2)
- #stage 1.5
- x = 0
- if stageiteration % 80 == 0 and level == 1 and stageiteration > 2000:
- if stageiteration in [2080, 2320, 2560, 2800, 3040, 3280, 3520, 3760, 4000]:
- x = -200
- if stageiteration in [2160, 2400, 2640, 2880, 3120, 3360, 3600, 3840]:
- x = -55
- if stageiteration in [2240, 2480, 2720, 2960, 3200, 3440, 3680, 3920]:
- x = 90
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- st1brick.append(brickb)
- st1brick.append(brickb2)
- if stageiteration == 4001 and level== 1:
- level = 2
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 2', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- level= 2
- lives = 20
- movedirx = 0
- energyint = 71
- #stage 1_end
- #____________________stage 2_____________________
- if stageiteration % 80 == 0 and level == 2 and stageiteration < 2001:
- x = 0
- if stageiteration in [320, 400, 720, 880, 1440, 1760]:
- x = -150
- choice2 = True
- if stageiteration in [80, 560, 1120, 1360, 1840]:
- x = 0
- choice2 = True
- if stageiteration in [160, 480, 960, 1200, 1600, 1680]:
- x = 150
- choice2 = True
- if stageiteration in [240, 640, 1040, 1280]:
- choice2 = False
- x = 80
- if stageiteration in [800, 1520, 1920, 2000]:
- choice2 = False
- x = -80
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- st1brick.append(brickb)
- st1brick.append(brickb2)
- if choice2== True:
- st1brick.append(brickb3)
- #stage 2.5
- if stageiteration % 80 == 0 and level == 2 and stageiteration > 2000:
- x = 0
- if stageiteration in [2320, 2400, 2720, 2880, 3440, 3760]:
- x = -150
- choice2 = True
- if stageiteration in [2080, 2560, 3120, 3360, 3840]:
- x = 0
- choice2 = False
- if stageiteration in [2160, 2480, 2960, 3200, 3600, 3680]:
- x = 150
- choice2 = True
- if stageiteration in [240, 2640, 3040, 3280]:
- choice = False
- x = 80
- if stageiteration in [2800, 3520, 3920, 4000]:
- choice2 = False
- x = -80
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- if choice2 == True:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice2 == False:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- if stageiteration == 4001 and level== 2:
- level = 3
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 3', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #stage 2_end
- #____________________stage 3_____________________
- if stageiteration % 80 == 0 and level == 3 and stageiteration < 2001:
- x = 0
- if stageiteration in [80, 560, 1120, 1360, 1840]:
- x = -150
- choice2 = True
- if stageiteration in [160, 480, 960, 1200, 1600, 1680]:
- x = 0
- choice2 = False
- if stageiteration in [240, 640, 1040, 1280]:
- x = 150
- choice2 = True
- if stageiteration in [320, 400, 720, 880, 1440, 1760]:
- choice2 = False
- x = 70
- if stageiteration in [800, 1520, 1920, 2000]:
- choice2 = True
- x = -70
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- if choice2 == True:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice2 == False:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- #stage 3.5
- if stageiteration % 80 == 0 and level == 3 and stageiteration > 2000:
- x = 0
- if stageiteration in [2320, 2400, 2720, 2880, 3440, 3760]:
- x = -150
- choice2 = True
- choice3 = False
- if stageiteration in [2080, 2560, 3120, 3360, 3840]:
- x = 0
- choice3 = True
- choice2 = False
- if stageiteration in [2160, 2480, 2960, 3200, 3600, 3680]:
- x = 150
- choice2 = True
- choice3 = False
- if stageiteration in [2240, 2640, 3040, 3280]:
- choice3 = True
- choice2 = False
- x = 80
- if stageiteration in [2800, 3520, 3920, 4000]:
- choice3 = True
- choice2 = False
- x = -80
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- if stageiteration == 4001 and level== 3:
- level = 4
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 4', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #stage 3_end
- #____________________stage 4_____________________:
- if stageiteration % 80 == 0 and level == 4 and stageiteration < 2001:
- if stageiteration in [320, 400, 720, 880, 1440, 1760]:
- x = -155
- choice1 = True
- choice2 = False
- if stageiteration in [80, 560, 1120, 1360, 1840]:
- x = 0
- choice1 = True
- choice2 = False
- if stageiteration in [160, 480, 960, 1200, 1600, 1680]:
- x = 40
- choice1 = True
- choice2 = False
- if stageiteration in [240, 640, 1040, 1280]:
- choice2 = True
- choice1 = False
- x = 80
- if stageiteration in [800, 1520, 1920, 2000]:
- choice2 = True
- choice1 = False
- x = -75
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- #stage 4.5
- if stageiteration % 80 == 0 and level == 4 and stageiteration > 2000:
- x = 0
- if stageiteration in [2720, 2880, 3440, 3760]:
- x = -150
- choice3 = True
- if stageiteration in [2320, 2400, 2080, 2560, 3120, 3360, 3840]:
- x = 0
- choice1 = True
- if stageiteration in [2960, 3200, 3600, 3680]:
- x = 150
- choice3 = True
- if stageiteration in [2240, 2640, 3040, 3280]:
- choice1 = True
- x = 80
- if stageiteration in [2160, 2480, 2800, 3520, 3920, 4000]:
- choice2 = True
- x = -80
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- if choice1:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice2:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- if choice3:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if stageiteration == 4001 and level== 4:
- level = 5
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 5', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #stage 4_end
- #____________________stage 5_____________________:
- if stageiteration % 80 == 0 and level == 5 and stageiteration < 2001:
- if stageiteration in [720, 880, 1440, 1760, 400, 80, 560]:
- x = -150
- choice3 = True
- if stageiteration in [320, 1120, 1360, 1840]:
- x = 0
- choice1 = True
- if stageiteration in [960, 1200, 1600, 1680]:
- x = 150
- choice3 = True
- if stageiteration in [160, 480, 800, 1520, 1920, 2000]:
- choice1 = True
- x = 80
- if stageiteration in [240, 640, 1040, 1280]:
- choice2 = True
- x = -80
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- if choice1:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice2:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- if choice3:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- #stage 5.5
- if stageiteration % 80 == 0 and level == 5 and stageiteration > 2000:
- x = 0
- if stageiteration in [2720, 2880, 3440, 3760]:
- x = -150
- choice3 = True
- if stageiteration in [2320, 2400, 2560, 3120, 3360, 3840]:
- x = 0
- choice1 = True
- if stageiteration in [2960, 3200, 3600, 3680]:
- x = 150
- choice3 = True
- if stageiteration in [2240, 2640, 3040, 3280]:
- choice1 = True
- x = 80
- if stageiteration in [2160, 2480, 2800, 3920, 4000]:
- choice2 = True
- x = -80
- if stageiteration in [2080, 3520]:
- choiceh = True
- hx = -20
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 40
- if choice1:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice2:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- if choice3:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- choiceh = 0
- if stageiteration == 4001 and level == 5:
- level = 6
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 6', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #stage 5_end
- #____________________stage 6_____________________:
- if stageiteration % 70 == 0 and level == 6 and stageiteration < 2001:
- if stageiteration in [420, 630, 1260, 1330]:
- x = -150
- choice1 = True
- if stageiteration in [70, 490, 910, 1190, 1400, 1470]:
- x = 0
- choice1 = True
- if stageiteration in [210, 840, 1120, 1890]:
- choice2 = True
- x = 150
- if stageiteration in [210, 770, 1050, 1680, 1750]:
- x = 0
- choice2 = True
- if stageiteration in [140, 280, 560, 1540]:
- x = -150
- choice3 = True
- if stageiteration in [350, 770, 1610]:
- choice3 = True
- x = 80
- if stageiteration in [1960]:
- x = 150
- choice4 = True
- if stageiteration in []:
- choice4 = True
- x = 80
- if stageiteration in []:
- x = 80
- choice5 = True
- if stageiteration in [700, 980, 1820]:
- choice1 = True
- x = -80
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- #stage 6.5
- if stageiteration % 70 == 0 and level == 6 and stageiteration > 2000:
- x = 0
- if stageiteration in [2870, 3150, 3430]:
- x = -150
- choice1 = True
- if stageiteration in [2170, 3360, 3920, 3990]:
- x = 0
- choice1 = True
- if stageiteration in [1240, 3290, 3500]:
- choice2 = True
- x = 150
- if stageiteration in [2660, 2730, 2800]:
- x = 0
- choice2 = True
- if stageiteration in [2450, 3080]:
- x = -150
- choice3 = True
- if stageiteration in [2380, 3010, 3640, 3780]:
- choice3 = True
- x = 80
- if stageiteration in [2520, 2940, 3850]:
- x = 150
- choice4 = True
- if stageiteration in [2590, 3570, 3710]:
- choice4 = True
- x = 80
- if stageiteration in [3220]:
- choiceh = True
- hx = -80
- if stageiteration in [2310]:
- choice1 = True
- x = -80
- if stageiteration in [2100]:
- choiceh = True
- hx = -20
- if stageiteration in [2030]:
- choicee = True
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb3[0]- 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 40
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb5[0]- 192
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb6)
- st4brick.append(sbrickb5)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration == 4200 and level == 6:
- level = 7
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 7', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #stage 6_end
- #_______________________________stage 7_____________________________________:
- if stageiteration % 70 == 0 and level == 7 and stageiteration < 2001:
- x = 0
- if stageiteration in [420, 700, 1190, 210]:
- x = -150
- choice1 = True
- if stageiteration in [70, 1050, 1120, 1680, 1960]:
- x = 0
- choice1 = True
- if stageiteration in [140, 770, 1470]:
- choice2 = True
- x = 150
- if stageiteration in [350, 840, 980]:
- x = 0
- choice2 = True
- if stageiteration in [280, 1260, 1610, 1820]:
- x = -150
- choice3 = True
- if stageiteration in [630, 910, 1330, 1750]:
- choice3 = True
- x = 80
- if stageiteration in [560, 1400]:
- x = 150
- choice4 = True
- if stageiteration in [490, 1540, 1890]:
- choice4 = True
- x = -80
- if stageiteration in []:
- choiceh = True
- hx = -80
- if stageiteration in []:
- choice1 = True
- x = -80
- if stageiteration in []:
- choiceh = True
- hx = -20
- if stageiteration in []:
- choicee = True
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 40
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2 == True:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if stageiteration % 70 == 0 and level == 7 and stageiteration > 2025:
- x = 0
- if stageiteration in [2030, 3290, 3710]:
- x = -90
- choice4 = True
- if stageiteration in [2520, 3640]:
- x = -10
- choice1 = True
- if stageiteration in [2100, 3010, 3570]:
- choice2 = True
- x = 140
- if stageiteration in [2450, 2940, 3500]:
- x = 5
- choice3 = True
- if stageiteration in [2100, 2730, 3430, 3780]:
- x = -130
- choice3 = True
- if stageiteration in [2170, 2870, 3360, 3990]:
- choice3 = True
- x = 90
- if stageiteration in [2240, 2800, 3220, 3920]:
- x = 120
- choice4 = True
- if stageiteration in [2310, 2590, 3150, 3850]:
- choice4 = True
- x = 0
- if stageiteration in []:
- choiceh = True
- hx = -80
- if stageiteration in []:
- choice1 = True
- x = -80
- if stageiteration in [2660, 3080]:
- choiceh = True
- hx = -40
- if stageiteration in [2380]:
- choicee = True
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration == 4200 and level == 7:
- level = 8
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 8', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #________________________________________stage 7__End_____________________________:
- #_______________________________stage 8_____________________________________:
- if stageiteration % 70 == 0 and level == 8 and stageiteration < 2001:
- x = 0
- if stageiteration in [350, 840, 980]:
- x = -90
- choice4 = True
- if stageiteration in [140, 770, 1470]:
- x = -10
- choice1 = True
- if stageiteration in [70, 1050, 1120, 1680, 1960]:
- choice2 = True
- x = 140
- if stageiteration in [420, 700, 1190, 210]:
- x = 5
- choice3 = True
- if stageiteration in [490, 1540, 1890]:
- x = -130
- choice3 = True
- if stageiteration in [280, 1260, 1610, 1820]:
- choice3 = True
- x = 90
- if stageiteration in [630, 910, 1330, 1750]:
- x = 120
- choice4 = True
- if stageiteration in [560, 1400]:
- choice4 = True
- x = 0
- if stageiteration in []:
- choiceh = True
- hx = -80
- if stageiteration in []:
- choice1 = True
- x = -80
- if stageiteration in [2660, 3080]:
- choiceh = True
- hx = -40
- if stageiteration in [2380]:
- choicee = True
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration % 70 == 0 and level == 8 and stageiteration > 2025:
- x = 0
- if stageiteration in [2030, 2170, 3010, 3780, 3290, 3710]:
- x = 0
- choice5 = True
- if stageiteration in [2590, 3080, 3500]:
- x = 150
- choice2 = True
- if stageiteration in [2380, 2730]:
- choice2 = True
- x = 80
- if stageiteration in [2660, 2800, 3640]:
- x = 30
- choice5 = True
- if stageiteration in [2100, 3220, 3990]:
- x = -150
- choice4 = True
- if stageiteration in [2310, 2870, 3360, 3850]:
- choice3 = True
- x = -80
- if stageiteration in [2450, 2940, 3430, 3570]:
- x = 30
- choice3 = True
- if stageiteration in [2520, 3150, 3920]:
- choice4 = True
- x = -30
- if stageiteration in [2240]:
- choiceh = True
- hx = -80
- if stageiteration in [2590, 3080, 3500]:
- choice5 = True
- x = -5
- if stageiteration in [3500]:
- choiceh = 1
- choicee = 0
- choice = 0
- hx = -20
- if stageiteration in [2030]:
- choicee = 1
- choiceh = 0
- choice = 0
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration == 4200 and level == 8:
- level = 9
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 9', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #________________________________________stage 8__End_____________________________:
- #_______________________________stage 9_____________________________________:
- if stageiteration % 70 == 0 and level == 9 and stageiteration < 2001:
- x = 0
- if stageiteration in [70, 1050, 1120, 1680, 1960]:
- x = -90
- choice4 = True
- if stageiteration in [140, 770, 1470]:
- x = -10
- choice1 = True
- if stageiteration in [630, 910, 1330, 1750]:
- choice2 = True
- x = 140
- if stageiteration in [420, 700, 1190, 210]:
- x = 5
- choice3 = True
- if stageiteration in [490, 1540, 1890]:
- x = -130
- choice3 = True
- if stageiteration in [280, 1260, 1610, 1820]:
- choice3 = True
- x = 90
- if stageiteration in [350, 840, 980]:
- x = 120
- choice4 = True
- if stageiteration in [560, 1400]:
- choice4 = True
- x = 0
- if stageiteration in []:
- choiceh = True
- hx = -80
- if stageiteration in []:
- choice1 = True
- x = -80
- if stageiteration in []:
- choiceh = True
- hx = -40
- if stageiteration in []:
- choicee = True
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- rbrickb4 = list(rbrickbody)
- rbrickb4[0] = rbrickb4[0]- 210
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- st5brick.append(rbrickb4)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration % 70 == 0 and level == 9 and stageiteration > 2025:
- x = 0
- if stageiteration in [2030, 2170, 3010]:
- x = 0
- choice5 = True
- if stageiteration in [2590, 3080, 3500]:
- x = 150
- choice2 = True
- if stageiteration in [2380]:
- choice2 = True
- x = 80
- if stageiteration in [2660, 2800, 3640]:
- x = -80
- choice5 = True
- if stageiteration in [2100, 3220, 3990, 3360, 3850]:
- x = -150
- choice4 = True
- if stageiteration in [2310, 2870, 3430, 3570]:
- choice3 = True
- x = -80
- if stageiteration in [2450, 2940]:
- x = 30
- choice3 = True
- if stageiteration in [2520, 3150, 3920, 3780, 3290, 3710]:
- choice4 = True
- x = -30
- if stageiteration in [2240]:
- choiceh = True
- hx = -80
- if stageiteration in [2030, 3080, 3500, 2730]:
- choice5 = True
- x = -80
- if stageiteration in [2590]:
- choiceh = 1
- choicee = 0
- choice = 0
- hx = -20
- if stageiteration in [3500]:
- choicee = 1
- choiceh = 0
- choice = 0
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- rbrickb4 = list(rbrickbody)
- rbrickb4[0] = rbrickb4[0]+ 220
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- st5brick.append(rbrickb4)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration == 4200 and level == 9:
- level = 10
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('stage 10', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #________________________________________stage 9__End_____________________________:
- #_______________________________stage 10_____________________________________:
- if stageiteration % 70 == 0 and level == 10 and stageiteration < 2001:
- x = 0
- if stageiteration in [1050, 1120, 1680, 1960]:
- x = -90
- choice4 = True
- if stageiteration in [70, 140, 770, 1470]:
- x = -10
- choice1 = True
- if stageiteration in [630, 910, 1330, 1750]:
- choice2 = True
- x = -80
- if stageiteration in [210, 420, 1190]:
- x = 5
- choice3 = True
- if stageiteration in [490, 1540, 1890]:
- x = -130
- choice3 = True
- if stageiteration in [280, 1260, 1610, 1820]:
- choice3 = True
- x = 90
- if stageiteration in [350, 840, 980]:
- x = 120
- choice4 = True
- if stageiteration in [560, 1400, 700]:
- choice4 = True
- x = 0
- if stageiteration in []:
- choiceh = True
- hx = -80
- if stageiteration in []:
- choice1 = True
- x = -80
- if stageiteration in []:
- choiceh = True
- hx = -40
- if stageiteration in []:
- choicee = True
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- hbrickb4 = list(hbrickbody)
- hbrickb4[0] = hbrickb4[0]- 220
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- brickb5 = list(brickbody)
- brickb5[0] = brickb5[0]- 220
- brickb6 = list(brickbody)
- brickb6[0] = brickb6[0]- 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- sbrickb7 = list(sbrickbody)
- sbrickb7[0] = sbrickb6[0]- 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- rbrickb4 = list(rbrickbody)
- rbrickb4[0] = rbrickb4[0]- 210
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- st1brick.append(brickb5)
- st1brick.append(brickb6)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- st4brick.append(sbrickb7)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- st5brick.append(rbrickb4)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration % 70 == 0 and level == 10 and stageiteration > 2025:
- x = 0
- if stageiteration in [2030, 2170, 3010]:
- x = 60
- choice5 = True
- if stageiteration in [2590, 3080, 3500]:
- x = 150
- choice2 = True
- if stageiteration in [2380]:
- choice2 = True
- x = 80
- if stageiteration in [2660, 2800, 3640]:
- x = +30
- choice5 = True
- if stageiteration in [2100, 3220, 3990, 3360, 3850]:
- x = -150
- choice4 = True
- if stageiteration in [2310, 2870, 3430, 3570]:
- choice3 = True
- x = -80
- if stageiteration in [2450, 2940]:
- x = 30
- choice3 = True
- if stageiteration in [2520, 3150, 3920, 3780, 3290, 3710]:
- choice4 = True
- x = -30
- if stageiteration in [2240]:
- choiceh = True
- hx = -80
- if stageiteration in [2030, 3080, 3500, 2730]:
- choice5 = True
- x = +90
- if stageiteration in [2590]:
- choiceh = 1
- choicee = 0
- choice = 0
- hx = -20
- if stageiteration in []:
- choicee = 1
- choiceh = 0
- choice = 0
- ex = -30
- hbrickbody.top = windowSurface.get_rect().top
- hbrickbody.centerx = windowSurface.get_rect().centerx + x
- hbrickb = list(hbrickbody)
- hbrickb2 = list(hbrickbody)
- hbrickb2[0] = hbrickb2[0]+ 110
- hbrickb3 = list(hbrickbody)
- hbrickb3[0] = hbrickb3[0]- 110
- brickbody.top = windowSurface.get_rect().top
- brickbody.centerx = windowSurface.get_rect().centerx + x
- brickb = list(brickbody)
- brickb2 = list(brickbody)
- brickb2[0] = brickb2[0]+ 110
- brickb3 = list(brickbody)
- brickb3[0] = brickb3[0]- 110
- brickb4 = list(brickbody)
- brickb4[0] = brickb4[0]+ 220
- sbrickbody.top = windowSurface.get_rect().top
- sbrickbody.centerx = windowSurface.get_rect().centerx + x
- sbrickb = list(sbrickbody)
- sbrickb2 = list(sbrickbody)
- sbrickb2[0] = sbrickb2[0]+ 64
- sbrickb3 = list(sbrickbody)
- sbrickb3[0] = sbrickb3[0]- 64
- sbrickb4 = list(sbrickbody)
- sbrickb4[0] = sbrickb4[0]- 128
- sbrickb5 = list(sbrickbody)
- sbrickb5[0] = sbrickb5[0]+ 128
- sbrickb6 = list(sbrickbody)
- sbrickb6[0] = sbrickb6[0]+ 192
- ibrickbody.top = windowSurface.get_rect().top
- ibrickbody.centerx = windowSurface.get_rect().centerx + x
- ibrickb = list(ibrickbody)
- ibrickb2 = list(ibrickbody)
- ibrickb2[0] = ibrickb2[0]+ 110
- ibrickb3 = list(ibrickbody)
- ibrickb3[0] = ibrickb3[0]- 110
- rbrickb = list(rbrickbody)
- rbrickb2 = list(rbrickbody)
- rbrickb2[0] = rbrickb2[0]+ 110
- rbrickb3 = list(rbrickbody)
- rbrickb3[0] = rbrickb3[0]- 110
- rbrickb4 = list(rbrickbody)
- rbrickb4[0] = rbrickb4[0]+ 220
- hpbody.top = windowSurface.get_rect().top - 300
- hpbody.centerx = windowSurface.get_rect().centerx + hx
- hpb = list(hpbody)
- hpb2 = list(hpbody)
- hpb2[0] = hpb[0]+ 80
- epbody.top = windowSurface.get_rect().top - 100
- epbody.centerx = windowSurface.get_rect().centerx + ex
- epb = list(epbody)
- epb2 = list(epbody)
- epb2[0] = epb[0]+ 60
- if choice1:
- st1brick.append(brickb)
- st1brick.append(brickb2)
- st1brick.append(brickb3)
- st1brick.append(brickb4)
- if choice2:
- st3brick.append(hbrickb)
- st3brick.append(hbrickb2)
- st3brick.append(hbrickb3)
- if choice3:
- st4brick.append(sbrickb)
- st4brick.append(sbrickb2)
- st4brick.append(sbrickb3)
- st4brick.append(sbrickb4)
- st4brick.append(sbrickb5)
- st4brick.append(sbrickb6)
- if choice4:
- st2brick.append(ibrickb)
- st2brick.append(ibrickb2)
- st2brick.append(ibrickb3)
- if choice5:
- st5brick.append(rbrickb)
- st5brick.append(rbrickb2)
- st5brick.append(rbrickb3)
- st5brick.append(rbrickb4)
- if choiceh:
- st1hp.append(hpb)
- st1hp.append(hpb2)
- if choicee:
- st1ep.append(epb)
- st1ep.append(epb2)
- if stageiteration == 4200 and level == 10:
- level = 11
- stageiteration = 0
- windowSurface.fill(black)
- textstage2 = basicfont.render('The End', True, (255, 255, 255), (0 , 0 , 0))
- tstage2rect= textstage2.get_rect()
- tstage2rect.centerx = windowSurface.get_rect().centerx
- tstage2rect.centery = windowSurface.get_rect().centery
- windowSurface.blit(textstage2, tstage2rect)
- pygame.display.update()
- sleep(3)
- lives = 20
- movedirx = 0
- energyint = 71
- #________________________________________stage 10__End_____________________________:
- choiceh = None
- choicee = None
- choice1 = None
- choice2 = None
- choice3 = None
- choice4 = None
- choice5 = None
- return stageiteration, st1brick, st2brick, st3brick, st4brick, st5brick, st1hp, st1hp, x, level, lives, energyint, movedirx, st1ep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement