Advertisement
Guest User

A-MaYheM Source code

a guest
Jan 23rd, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #By Mr.A a.k.a A-MAN
  2. #
  3. #All rights for this code are reserved for the only creator.
  4. #
  5. #No part of this code can be ediited or changed by any other coder except with permision.
  6. #
  7. #CopyRights 2011-2012 by Mr.A
  8.  
  9.  
  10. import pygame, sys, random
  11. import levels
  12. from pygame.locals import *
  13. from time import *
  14. GAMENAME = 'A-MaYheM'
  15. WINDOWWIDTH = 600
  16. WINDOWHEIGHT = 600
  17. PLAYERSPEED = 9
  18. BACKCOLOR = (0, 0, 0)
  19. FPS = 200
  20. carspeed = 100
  21. MOUSEAPPEAR = True
  22. pygame.init()
  23. pygame.mixer.init()
  24. pygame.mixer.pre_init(22050, -16, 4, 4096)
  25. music = ['1.ogg', '2.ogg' , '3.ogg']
  26. pygame.mixer.music.load(music[0])
  27. movedirx = 0
  28. movediry = 0
  29. passmen = True
  30. black = (0, 0, 0)
  31. Clock = pygame.time.Clock()
  32. pygame.display.set_caption(GAMENAME)
  33. windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDOWHEIGHT), 0, 32)
  34. crypo= 74
  35. pause = 1
  36. t2colpi = True
  37. basicfont = pygame.font.SysFont(None, 50)
  38. energyfont = pygame.font.SysFont(None, 35)
  39. stagefont = pygame.font.SysFont(None, 80)
  40. passfont = pygame.font.SysFont(None, 40)
  41. wrongpassfont = pygame.font.SysFont(None, 20)
  42. threetwoone = pygame.font.SysFont(None, 110)
  43. gosys = pygame.font.SysFont(None, 200)
  44. scorefont = pygame.font.SysFont(None, 35)
  45. carxop = False
  46. passyfile = open('passy.roc', 'r')
  47. passytext = passyfile.read()
  48. if passytext != "omar":
  49.  
  50.     p0= pygame.image.load('mycar0.bmp').convert()
  51.     p0b= p0.get_rect()
  52.     p1= pygame.image.load('mycar1.bmp').convert()
  53.     p1b= p1.get_rect()
  54.     p2= pygame.image.load('mycar2.bmp').convert()
  55.     p2b= p2.get_rect()
  56.     p= pygame.image.load('mycar.bmp').convert()
  57.     pb= p.get_rect()
  58. else:
  59.     carxop = True
  60. if carxop:
  61.     p0= pygame.image.load('carx0.bmp').convert()
  62.     p0b= p0.get_rect()
  63.     p1= pygame.image.load('carx1.bmp').convert()
  64.     p1b= p1.get_rect()
  65.     p2= pygame.image.load('carx2.bmp').convert()
  66.     p2b= p2.get_rect()
  67.     p= pygame.image.load('carx.bmp').convert()
  68.     pb= p.get_rect()    
  69. passyfile.close
  70.  
  71. if carxop:
  72.     PLAYERSPEED = 15
  73.    
  74. t3isthere = False
  75. t5isthere = False
  76. fx= random.randint(70, 630)
  77.  
  78. windowSurface.fill(black)
  79. pygame.display.update()
  80. credit= pygame.image.load('cred.bmp').convert()
  81. creditb = credit.get_rect()
  82. creditb.center = windowSurface.get_rect().center
  83. windowSurface.blit(credit, creditb)
  84. pygame.display.update()
  85. sleep(3)
  86.  
  87.  
  88. #_______________trackssp_________:
  89. track1= pygame.image.load('track1.bmp').convert()
  90. track1b= track1.get_rect()
  91. t1bordr = pygame.image.load('t1border.bmp').convert()
  92. t1bordrb= t1bordr.get_rect()
  93. t1bordrb.centery =  windowSurface.get_rect().centery
  94. t1bordrb.right = windowSurface.get_rect().width
  95. t1bordl = pygame.image.load('t1border.bmp').convert()
  96. t1bordlb = t1bordl.get_rect()
  97. t1bordlb.centery =  windowSurface.get_rect().centery
  98. t1bordlb.left = 0
  99.  
  100.  
  101. t2bordr = pygame.image.load('t2border.bmp').convert()
  102. t2bordrb= t2bordr.get_rect()
  103. t2bordrb.centery =  windowSurface.get_rect().centery
  104. t2bordrb.right = windowSurface.get_rect().width
  105. t2bordl = pygame.image.load('t2border.bmp').convert()
  106. t2bordlb = t2bordl.get_rect()
  107. t2bordlb.centery =  windowSurface.get_rect().centery
  108. t2bordlb.left = 0
  109. track2= pygame.image.load('track2.bmp').convert()
  110. track2b= track2.get_rect()
  111. track2line= pygame.image.load('track2line.bmp').convert()
  112. track2lineb= track2line.get_rect()
  113. track2line2= pygame.image.load('track2line2.bmp').convert()
  114. track2line2b= track2line2.get_rect()
  115. track2line3= pygame.image.load('track2line3.bmp').convert()
  116. track2line3b= track2line3.get_rect()
  117. t2line2color = [track2line, track2line2, track2line3]
  118. track2lineb.bottom = windowSurface.get_rect().top
  119. track2lineb.centerx = windowSurface.get_rect().centerx - 175
  120. track2line2b.bottom = windowSurface.get_rect().top - 300
  121. track2line2b.centerx = windowSurface.get_rect().centerx + 175
  122. track2line3b.bottom = windowSurface.get_rect().top - 600
  123. track2line3b.centerx = windowSurface.get_rect().centerx
  124.  
  125. track3= pygame.image.load('track3.bmp').convert()
  126. track3b= track3.get_rect()
  127. t3bordr = pygame.image.load('t3border.bmp').convert()
  128. t3bordrb= t3bordr.get_rect()
  129. t3bordrb.centery =  windowSurface.get_rect().centery
  130. t3bordrb.right = windowSurface.get_rect().width
  131. t3bordl = pygame.image.load('t3border.bmp').convert()
  132. t3bordlb = t3bordl.get_rect()
  133. t3bordlb.centery =  windowSurface.get_rect().centery
  134. t3bordlb.left = 0
  135. t3cov = pygame.image.load('track3_top.bmp').convert()
  136. t3ani = pygame.image.load('track3_ani.bmp').convert()
  137. t3anib1 = t3ani.get_rect()
  138. t3anib2 = t3ani.get_rect()
  139. t3anib1.centerx = windowSurface.get_rect().centerx
  140. t3anib1.bottom = windowSurface.get_rect().top - 600
  141. t3anib2.centerx = windowSurface.get_rect().centerx
  142. t3anib2.bottom = windowSurface.get_rect().top - 300
  143.  
  144. track4= pygame.image.load('track4.bmp').convert()
  145. track4b= track4.get_rect()
  146. t4thundl1= pygame.image.load('thundr1.bmp').convert()
  147. t4thundl2= pygame.image.load('thundr2.bmp').convert()
  148. t4thundl3= pygame.image.load('thundr3.bmp').convert()
  149. t4thundr1= pygame.image.load('thundl1.bmp').convert()
  150. t4thundr2= pygame.image.load('thundl2.bmp').convert()
  151. t4thundr3= pygame.image.load('thundl3.bmp').convert()
  152. t4thundl1b= t4thundl1.get_rect()
  153. t4thundl2b= t4thundl2.get_rect()
  154. t4thundl3b= t4thundl3.get_rect()
  155. t4thundr1b= t4thundr1.get_rect()
  156. t4thundr2b= t4thundr2.get_rect()
  157. t4thundr3b= t4thundr3.get_rect()
  158.  
  159. t4thundl1b.top = windowSurface.get_rect().top
  160. t4thundl1b.left = windowSurface.get_rect().left + 120
  161. t4thundr1b.right = windowSurface.get_rect().right - 120
  162. t4thundr1b.top = windowSurface.get_rect().top
  163.  
  164. t4thundl2b.top = windowSurface.get_rect().top
  165. t4thundl2b.left = windowSurface.get_rect().left + 120
  166. t4thundr2b.right = windowSurface.get_rect().right - 120
  167. t4thundr2b.top = windowSurface.get_rect().top
  168.  
  169. t4thundl3b.top = windowSurface.get_rect().top
  170. t4thundl3b.left = windowSurface.get_rect().left + 120
  171. t4thundr3b.right = windowSurface.get_rect().right - 120
  172. t4thundr3b.top = windowSurface.get_rect().top
  173.  
  174. track5= pygame.image.load('track5.bmp').convert()
  175. track5b= track5.get_rect()
  176. t5bordr = pygame.image.load('t5border.bmp').convert()
  177. t5bordrb= t5bordr.get_rect()
  178. t5bordrb.centery =  windowSurface.get_rect().centery
  179. t5bordrb.right = windowSurface.get_rect().width
  180. t5bordl = pygame.image.load('t5border.bmp').convert()
  181. t5bordlb = t5bordl.get_rect()
  182. t5bordlb.centery =  windowSurface.get_rect().centery
  183. t5bordlb.left = 0
  184. t5flake1 = pygame.image.load('track5_flake1.bmp').convert()
  185. t5flake1b1 = t5flake1.get_rect()
  186. t5flake1b2 = t5flake1.get_rect()
  187. t5flake1b3 = t5flake1.get_rect()
  188. t5flake1b4 = t5flake1.get_rect()
  189. t5flake1b5 = t5flake1.get_rect()
  190. t5flake1b1.bottom= windowSurface.get_rect().top - 100
  191. t5flake1b2.bottom= windowSurface.get_rect().top - 250
  192. t5flake1b3.bottom= windowSurface.get_rect().top - 400
  193. t5flake1b4.bottom= windowSurface.get_rect().top - 550
  194. t5flake1b5.bottom= windowSurface.get_rect().top - 700
  195. t5flake1bteam= [t5flake1b1, t5flake1b2, t5flake1b3, t5flake1b4, t5flake1b5]
  196. t5flake1b1.centerx= windowSurface.get_rect().left + 530
  197. t5flake1b2.centerx= windowSurface.get_rect().left + 170
  198. t5flake1b3.centerx= windowSurface.get_rect().left + 430
  199. t5flake1b4.centerx= windowSurface.get_rect().left + 70
  200. t5flake1b5.centerx= windowSurface.get_rect().left + 280
  201. t5cov = pygame.image.load('t5top.bmp').convert()
  202. #_______________end_________:
  203.  
  204. p0b.centerx = windowSurface.get_rect().centerx
  205. p0b.centery = windowSurface.get_rect().centery
  206. p1b.centerx = windowSurface.get_rect().centerx
  207. p1b.centery = windowSurface.get_rect().centery
  208. p2b.centerx = windowSurface.get_rect().centerx
  209. p2b.centery = windowSurface.get_rect().centery
  210. playerpics= [p0, p1, p2]*1200
  211. playerbodies= [p0b, p1b, p2b]*1200
  212. laser0= pygame.image.load('laserbeam.bmp').convert()
  213. laser1= pygame.image.load('laserbeamb.bmp').convert()
  214. claser0= pygame.image.load('claserbeam.bmp').convert()
  215. claser1= pygame.image.load('claserbeamb.bmp').convert()
  216. laser2= pygame.image.load('c1.bmp').convert()
  217. claser2= pygame.image.load('c2.bmp').convert()
  218. ESH1 = pygame.image.load('Esh1.bmp').convert()
  219. ESH2 = pygame.image.load('Esh2.bmp').convert()
  220. brick = pygame.image.load('lobstacle.bmp').convert()
  221. ibrick = pygame.image.load('iobstacle.bmp').convert()
  222. hbrick = pygame.image.load('hobstacle.bmp').convert()
  223. sbrick = pygame.image.load('obstacle.bmp').convert()
  224. rbrick = pygame.image.load('robstacle.bmp').convert()
  225. hp = pygame.image.load('hp.bmp').convert()
  226. ep = pygame.image.load('energy.bmp').convert()
  227. AZone = pygame.image.load('A-zone.bmp').convert()
  228.  
  229.  
  230. attacks = [laser0, laser1, claser0, claser1, laser2, claser2, ESH2, ESH1]
  231. Eshield= [ESH1, ESH2]
  232. laser0b = laser0.get_rect()
  233. laser1b = laser1.get_rect()
  234. claser0b = claser0.get_rect()
  235. claser1b = claser1.get_rect()
  236. laser2b = laser2.get_rect()
  237. claser2b = claser2.get_rect()
  238. ESHb = ESH1.get_rect()
  239. brickbody= brick.get_rect()
  240. ibrickbody= ibrick.get_rect()
  241. hbrickbody= hbrick.get_rect()
  242. sbrickbody = sbrick.get_rect()
  243. rbrickbody = rbrick.get_rect()
  244. hpbody = hp.get_rect()
  245. epbody = ep.get_rect()
  246. AZoneb = AZone.get_rect()
  247. AZoneb.centerx = windowSurface.get_rect().centerx
  248. AZoneb.centery = -25
  249.  
  250. objects = [brick, ibrick, hbrick, sbrick, rbrick, AZone]
  251. #___________________explosions___________________:
  252. exp0 = pygame.image.load('exp0.bmp').convert()
  253. exp1 = pygame.image.load('exp1.bmp').convert()
  254. exp2 = pygame.image.load('exp2.bmp').convert()
  255. exp3 = pygame.image.load('exp3.bmp').convert()
  256. exp4 = pygame.image.load('exp4.bmp').convert()
  257. exp5 = pygame.image.load('exp5.bmp').convert()
  258. exp6 = pygame.image.load('exp6.bmp').convert()
  259. exp7 = pygame.image.load('exp7.bmp').convert()
  260. exp8 = pygame.image.load('exp8.bmp').convert()
  261. exp9 = pygame.image.load('exp9.bmp').convert()
  262. exp10 = pygame.image.load('exp10.bmp').convert()
  263. exp11 = pygame.image.load('exp11.bmp').convert()
  264. exb0 = exp0.get_rect()
  265. exb1 = exp1.get_rect()
  266. exb2 = exp2.get_rect()
  267. exb3 = exp3.get_rect()
  268. exb4 = exp4.get_rect()
  269. exb5 = exp5.get_rect()
  270. exb6 = exp6.get_rect()
  271. exb7 = exp7.get_rect()
  272. exb8 = exp8.get_rect()
  273. exb9 = exp9.get_rect()
  274. exb10 = exp10.get_rect()
  275. exb11 = exp11.get_rect()
  276. explosion= [exp0, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8, exp9, exp10, exp11]
  277. explosionb= [exb0, exb1, exb2, exb3, exb4, exb5, exb6, exb7, exb8, exb9, exb10, exb11]
  278. bexp0 = pygame.image.load('bexp0.bmp').convert()
  279. bexp1 = pygame.image.load('bexp1.bmp').convert()
  280. bexp2 = pygame.image.load('bexp2.bmp').convert()
  281. bexp3 = pygame.image.load('bexp3.bmp').convert()
  282. bexp4 = pygame.image.load('bexp4.bmp').convert()
  283. bexp5 = pygame.image.load('bexp5.bmp').convert()
  284. bexp6 = pygame.image.load('bexp6.bmp').convert()
  285. bexp7 = pygame.image.load('bexp7.bmp').convert()
  286. bexp8 = pygame.image.load('bexp8.bmp').convert()
  287. bexp9 = pygame.image.load('bexp9.bmp').convert()
  288. bigexplosion= [bexp0, bexp1, bexp2, bexp3, bexp4, bexp5, bexp6, bexp7, bexp8, bexp9]
  289. #end:
  290. energy = pygame.image.load('live.bmp').convert()
  291. energyb = energy.get_rect()
  292. #_____________bpad______________:
  293. bouncepadr = pygame.image.load('ruwa.bmp').convert()
  294. bouncepadrb= bouncepadr.get_rect()
  295. bouncepadrb.centery =  windowSurface.get_rect().centery
  296. bouncepadrb.right = windowSurface.get_rect().width
  297. bouncepadl = pygame.image.load('ruwa.bmp').convert()
  298. bouncepadlb= bouncepadl.get_rect()
  299. bouncepadlb.centery =  windowSurface.get_rect().centery
  300. bouncepadlb.left = 0
  301. #end:
  302. #_______passsysfilespreparation_________:
  303. num1 = pygame.image.load('1numb.bmp').convert()
  304. num2 = pygame.image.load('2numb.bmp').convert()
  305. num3 = pygame.image.load('3numb.bmp').convert()
  306. num4 = pygame.image.load('4numb.bmp').convert()
  307. num5 = pygame.image.load('5numb.bmp').convert()
  308. num6 = pygame.image.load('6numb.bmp').convert()
  309. num7 = pygame.image.load('7numb.bmp').convert()
  310. num8 = pygame.image.load('8numb.bmp').convert()
  311. num9 = pygame.image.load('9numb.bmp').convert()
  312. num0 = pygame.image.load('0numb.bmp').convert()
  313. numdel = pygame.image.load('delnumb.bmp').convert()
  314. numselection = pygame.image.load('pdnumb.bmp').convert()
  315. numpad = [num1, num2, num3, num4, num5, num6, num7, num8, num9, num0, numdel, numselection]
  316. num1bdy= num1.get_rect()
  317. num2bdy= num2.get_rect()
  318. num3bdy= num3.get_rect()
  319. num4bdy= num4.get_rect()
  320. num5bdy= num5.get_rect()
  321. num6bdy= num6.get_rect()
  322. num7bdy= num7.get_rect()
  323. num8bdy= num8.get_rect()
  324. num9bdy= num9.get_rect()
  325. num0bdy= num0.get_rect()
  326. numdelbdy= numdel.get_rect()
  327. numselectionbdy = numselection.get_rect()
  328. #end:
  329. #_______energy bar_________:
  330. eb1 = pygame.image.load('energy1.bmp').convert()
  331. eb2 = pygame.image.load('energy2.bmp').convert()
  332. eb3 = pygame.image.load('energy3.bmp').convert()
  333. eb4 = pygame.image.load('energy4.bmp').convert()
  334. eb5 = pygame.image.load('energy5.bmp').convert()
  335. eb6 = pygame.image.load('energy6.bmp').convert()
  336. eb7 = pygame.image.load('energy7.bmp').convert()
  337. eb8 = pygame.image.load('energy8.bmp').convert()
  338. eb9 = pygame.image.load('energy9.bmp').convert()
  339. eb10 = pygame.image.load('energy10.bmp').convert()
  340. eb11 = pygame.image.load('energy11.bmp').convert()
  341. eb12 = pygame.image.load('energy12.bmp').convert()
  342. eb13 = pygame.image.load('energy13.bmp').convert()
  343. eb14 = pygame.image.load('energy14.bmp').convert()
  344. eb15 = pygame.image.load('energy15.bmp').convert()
  345. eb16 = pygame.image.load('energy16.bmp').convert()
  346. eb17 = pygame.image.load('energy17.bmp').convert()
  347. eb18 = pygame.image.load('energy18.bmp').convert()
  348. eb19 = pygame.image.load('energy19.bmp').convert()
  349. eb20 = pygame.image.load('energy20.bmp').convert()
  350. eb21 = pygame.image.load('energy21.bmp').convert()
  351. eb22 = pygame.image.load('energy22.bmp').convert()
  352. eb23 = pygame.image.load('energy23.bmp').convert()
  353. eb24 = pygame.image.load('energy24.bmp').convert()
  354. eb25 = pygame.image.load('energy25.bmp').convert()
  355. eb26 = pygame.image.load('energy26.bmp').convert()
  356. eb27 = pygame.image.load('energy27.bmp').convert()
  357. eb28 = pygame.image.load('energy28.bmp').convert()
  358. eb29 = pygame.image.load('energy29.bmp').convert()
  359. eb30 = pygame.image.load('energy30.bmp').convert()
  360. eb31 = pygame.image.load('energy31.bmp').convert()
  361. eb32 = pygame.image.load('energy32.bmp').convert()
  362. eb33 = pygame.image.load('energy33.bmp').convert()
  363. eb34 = pygame.image.load('energy34.bmp').convert()
  364. eb35 = pygame.image.load('energy35.bmp').convert()
  365. eb36 = pygame.image.load('energy36.bmp').convert()
  366.  
  367. 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]
  368.  
  369. eb1b = eb1.get_rect()
  370. eb2b = eb2.get_rect()
  371. eb3b = eb3.get_rect()
  372. eb4b = eb4.get_rect()
  373. eb5b = eb5.get_rect()
  374. eb6b = eb6.get_rect()
  375. eb7b = eb7.get_rect()
  376. eb8b = eb8.get_rect()
  377. eb9b = eb9.get_rect()
  378. eb10b = eb10.get_rect()
  379. eb11b = eb11.get_rect()
  380. eb12b = eb12.get_rect()
  381. eb13b = eb13.get_rect()
  382. eb14b = eb14.get_rect()
  383. eb15b = eb15.get_rect()
  384. eb16b = eb16.get_rect()
  385. eb17b = eb17.get_rect()
  386. eb18b = eb18.get_rect()
  387. eb19b = eb19.get_rect()
  388. eb20b = eb20.get_rect()
  389. eb21b = eb21.get_rect()
  390. eb22b = eb22.get_rect()
  391. eb23b = eb23.get_rect()
  392. eb24b = eb24.get_rect()
  393. eb25b = eb25.get_rect()
  394. eb26b = eb26.get_rect()
  395. eb27b = eb27.get_rect()
  396. eb28b = eb28.get_rect()
  397. eb29b = eb29.get_rect()
  398. eb30b = eb30.get_rect()
  399. eb31b = eb31.get_rect()
  400. eb32b = eb32.get_rect()
  401. eb33b = eb33.get_rect()
  402. eb34b = eb34.get_rect()
  403. eb35b = eb35.get_rect()
  404. eb36b = eb36.get_rect()
  405.  
  406.  
  407. eb1b.top =  windowSurface.get_rect().top + 15
  408. eb1b.left = windowSurface.get_rect().centerx + 90
  409. #end:
  410.  
  411. def Close():
  412.     pygame.quit()
  413.     sys.exit()
  414.  
  415.  
  416. def Track1(track1, track1b):
  417.     windowSurface.blit(track1, track1b)
  418.     windowSurface.blit(t1bordl, t1bordlb)
  419.     windowSurface.blit(t1bordr, t1bordrb)
  420.  
  421.  
  422.  
  423. def Track2(track2, track1b):
  424.     windowSurface.blit(track2, track1b)
  425.  
  426.     if t2colpi == True and stageiteration % 100 == 0:
  427.         random.shuffle(t2line2color)
  428.  
  429.     windowSurface.blit(t2line2color[1], track2line3b)
  430.     windowSurface.blit(t2line2color[2], track2line2b)
  431.     windowSurface.blit(t2line2color[0], track2lineb)
  432.     windowSurface.blit(t2bordl, t1bordlb)
  433.     windowSurface.blit(t2bordr, t1bordrb)
  434.     track2line2b.top += vehiclespeed
  435.     track2lineb.top += vehiclespeed
  436.     track2line3b.top += vehiclespeed
  437.     if track2line2b.top > WINDOWHEIGHT:
  438.         track2line2b.bottom = windowSurface.get_rect().top
  439.         track2line2b.centerx = windowSurface.get_rect().centerx
  440.  
  441.     if track2lineb.top > WINDOWHEIGHT:
  442.         track2lineb.bottom = windowSurface.get_rect().top
  443.         track2lineb.centerx = windowSurface.get_rect().centerx - 175
  444.  
  445.     if track2line3b.top > WINDOWHEIGHT:
  446.         track2line3b.bottom = windowSurface.get_rect().top
  447.         track2line3b.centerx = windowSurface.get_rect().centerx + 175
  448.  
  449.     return track2line2b, track2lineb, track2line3b
  450.    
  451.    
  452. def Track3(track3, track1b):
  453.     global t3isthere
  454.     windowSurface.blit(track3, track1b)
  455.     windowSurface.blit(t3bordl, t1bordlb)
  456.     windowSurface.blit(t3bordr, t1bordrb)
  457.     t3isthere = True
  458.  
  459.  
  460.  
  461. def Track4(track4, track1b):
  462.     global t4isthere
  463.     windowSurface.blit(track4, track1b)
  464.     t4isthere = True
  465.  
  466.  
  467. def Track5(track5, track1b, t5flake1bteam):
  468.     global fx, t5isthere
  469.     t5isthere = True
  470.     windowSurface.blit(track5, track1b)
  471.     windowSurface.blit(t1bordl, t1bordlb)
  472.     windowSurface.blit(t1bordr, t1bordrb)
  473.     windowSurface.blit(t5bordl, t5bordlb)
  474.     windowSurface.blit(t5bordr, t5bordrb)
  475.  
  476.  
  477.     if t5isthere:
  478.         windowSurface.blit(t5flake1, t5flake1b1)
  479.         windowSurface.blit(t5flake1, t5flake1b2)
  480.         windowSurface.blit(t5flake1, t5flake1b3)
  481.         windowSurface.blit(t5flake1, t5flake1b4)
  482.         windowSurface.blit(t5flake1, t5flake1b5)
  483.     for a in t5flake1bteam:
  484.         if a.top > WINDOWHEIGHT:
  485.             fx= random.randint(70, 530)
  486.             fy = random.randint(200, 700)
  487.             a.centerx= windowSurface.get_rect().left+ fx
  488.             a.bottom= windowSurface.get_rect().top- fy
  489.     t5flake1b1.top += 7
  490.     t5flake1b2.top += 7
  491.     t5flake1b3.top += 7
  492.     t5flake1b4.top += 7
  493.     t5flake1b5.top += 7
  494.            
  495.    
  496.    
  497. def hsmenu():
  498.     _score_ = ''
  499.     scrtxtd= []
  500.     scrtxte= []
  501.     ASC_VAL= 0
  502.     chkscrtxt = open('HighScores.man', 'r')
  503.     scrtxteb= chkscrtxt.readlines()
  504.     for a in range(len(scrtxteb)):
  505.         scrtxte.append(scrtxteb[a].rstrip('\n'))
  506.    
  507.        
  508.     for a in scrtxte:
  509.         _score_ = ''
  510.         for symb in a:
  511.             ASC_VAL = ord(symb)
  512.             ASC_VAL -= crypo
  513.             if ASC_VAL > 126:
  514.                 ASC_VAL -= 94
  515.             if ASC_VAL < 32:
  516.                 ASC_VAL += 94
  517.             _score_  += chr(ASC_VAL)
  518.        
  519.         scrtxtd.append(_score_)
  520.        
  521.    
  522.     textscore1 = basicfont.render('1st.   '+ scrtxtd[0], True, (255, 0, 0), (0 , 0 , 0))
  523.     textscore2 = basicfont.render('2nd.  '+ scrtxtd[1], True, (0, 255, 0), (0 , 0 , 0))
  524.     textscore3 = basicfont.render('3rd.   '+ scrtxtd[2], True, (0, 0, 255), (0 , 0 , 0))    
  525.     textscore4 = basicfont.render('4th.    '+ scrtxtd[3], True, (255, 128, 0), (0 , 0 , 0))
  526.     textscore5 = basicfont.render('5th.    '+ scrtxtd[4], True, (0, 255, 128), (0 , 0 , 0))
  527.     textscore6 = basicfont.render('6th.    '+ scrtxtd[5], True, (128, 0, 255), (0 , 0 , 0))
  528.     textscore7 = basicfont.render('7th.    '+ scrtxtd[6], True, (0, 255, 255), (0 , 0 , 0))    
  529.     textscore8 = basicfont.render('8th.    '+ scrtxtd[7], True, (255, 255, 0), (0 , 0 , 0))
  530.     textscore9 = basicfont.render('9th.    '+ scrtxtd[8], True, (255, 0, 255), (0 , 0 , 0))
  531.     textscore10 = basicfont.render('10th.  '+ scrtxtd[9], True, (128, 128, 128), (0 , 0 , 0))
  532.     texttopscore = basicfont.render('Top Scores', True, (255, 255, 255), (0 , 0 , 0))
  533.     textscore1b = textscore1.get_rect()        
  534.     textscore2b = textscore2.get_rect()
  535.     textscore3b = textscore3.get_rect()
  536.     textscore4b = textscore4.get_rect()
  537.     textscore5b = textscore5.get_rect()
  538.     textscore6b = textscore6.get_rect()
  539.     textscore7b = textscore7.get_rect()
  540.     textscore8b = textscore8.get_rect()
  541.     textscore9b = textscore9.get_rect()
  542.     textscore10b = textscore10.get_rect()
  543.     texttopscoreb = texttopscore.get_rect()
  544.    
  545.     textscore1b.left = windowSurface.get_rect().left +150
  546.     textscore2b.left = windowSurface.get_rect().left +150
  547.     textscore3b.left = windowSurface.get_rect().left +150
  548.     textscore4b.left = windowSurface.get_rect().left +150
  549.     textscore5b.left = windowSurface.get_rect().left +150
  550.     textscore6b.left = windowSurface.get_rect().left +150
  551.     textscore7b.left = windowSurface.get_rect().left +150
  552.     textscore8b.left = windowSurface.get_rect().left +150
  553.     textscore9b.left = windowSurface.get_rect().left +150
  554.     textscore10b.left = windowSurface.get_rect().left +150
  555.     texttopscoreb.centerx = windowSurface.get_rect().centerx
  556.     textscore1b.centery = windowSurface.get_rect().top + 100
  557.     textscore2b.centery = windowSurface.get_rect().top + 150
  558.     textscore3b.centery = windowSurface.get_rect().top + 200
  559.     textscore4b.centery = windowSurface.get_rect().top + 250
  560.     textscore5b.centery = windowSurface.get_rect().top + 300
  561.     textscore6b.centery = windowSurface.get_rect().top + 350
  562.     textscore7b.centery = windowSurface.get_rect().top + 400
  563.     textscore8b.centery = windowSurface.get_rect().top + 450
  564.     textscore9b.centery = windowSurface.get_rect().top + 500
  565.     textscore10b.centery = windowSurface.get_rect().top + 550
  566.     texttopscoreb.centery = windowSurface.get_rect().top+ 50
  567.     while True:
  568.         windowSurface.fill(BACKCOLOR)
  569.         windowSurface.blit(textscore1, textscore1b)
  570.         windowSurface.blit(textscore2, textscore2b)
  571.         windowSurface.blit(textscore3, textscore3b)
  572.         windowSurface.blit(textscore4, textscore4b)
  573.         windowSurface.blit(textscore5, textscore5b)
  574.         windowSurface.blit(textscore6, textscore6b)
  575.         windowSurface.blit(textscore7, textscore7b)
  576.         windowSurface.blit(textscore8, textscore8b)
  577.         windowSurface.blit(textscore9, textscore9b)
  578.         windowSurface.blit(textscore10, textscore10b)
  579.         windowSurface.blit(texttopscore, texttopscoreb)
  580.         pygame.display.update()
  581.         for event in pygame.event.get():
  582.             if event.type == QUIT:
  583.                 Close()
  584.             if event.type == KEYDOWN:
  585.                 if event.key == K_ESCAPE:
  586.                     Close()
  587.                 if event.key == K_BACKSPACE:
  588.                     windowSurface.fill((0, 0, 0))
  589.                     return
  590.                
  591.  
  592.        
  593.  
  594.        
  595.  
  596. def passmenu():
  597.     password = []
  598.     wrong = False
  599.     Right = False
  600.     hplace = 25
  601.     while True:
  602.         for event in pygame.event.get():
  603.             if event.type == QUIT:
  604.                 Close()
  605.             if hplace == 25:
  606.                 if event.type == KEYDOWN:
  607.                     if event.key == K_LEFT:
  608.                         hplace = 575
  609.                     if event.key == K_RIGHT:
  610.                         hplace += 55
  611.                     if event.key == K_SPACE:
  612.                         password.append(1)
  613.                 if event.type == QUIT:
  614.                     Close()
  615.                 if event.type == KEYDOWN:
  616.                     if event.key == K_ESCAPE:
  617.                         Close()
  618.                     if event.key == K_BACKSPACE:
  619.                         windowSurface.fill((0, 0, 0))
  620.                         return                        
  621.             elif hplace == 80:
  622.                 if event.type == KEYDOWN:
  623.                     if event.key == K_RIGHT:
  624.                         hplace += 55
  625.                     if event.key == K_LEFT:
  626.                         hplace -= 55
  627.                     if event.key == K_SPACE:
  628.                         password.append(2)
  629.                 if event.type == QUIT:
  630.                     Close()
  631.                 if event.type == KEYDOWN:
  632.                     if event.key == K_ESCAPE:
  633.                         Close()
  634.                     if event.key == K_BACKSPACE:
  635.                         windowSurface.fill((0, 0, 0))
  636.                         return                        
  637.             elif hplace == 135:
  638.  
  639.  
  640.                 if event.type == KEYDOWN:
  641.                     if event.key == K_RIGHT:
  642.                         hplace += 55
  643.                     if event.key == K_LEFT:
  644.                         hplace -= 55
  645.                     if event.key == K_SPACE:
  646.                         password.append(3)
  647.                 if event.type == QUIT:
  648.                     Close()
  649.                 if event.type == KEYDOWN:
  650.                     if event.key == K_ESCAPE:
  651.                         Close()
  652.                     if event.key == K_BACKSPACE:
  653.                         windowSurface.fill((0, 0, 0))
  654.                         return                        
  655.             elif hplace == 190:
  656.  
  657.  
  658.                 if event.type == KEYDOWN:
  659.                     if event.key == K_RIGHT:
  660.                         hplace += 55
  661.                     if event.key == K_LEFT:
  662.                         hplace -= 55
  663.                     if event.key == K_SPACE:
  664.                         password.append(4)
  665.                 if event.type == QUIT:
  666.                     Close()
  667.                 if event.type == KEYDOWN:
  668.                     if event.key == K_ESCAPE:
  669.                         Close()
  670.                     if event.key == K_BACKSPACE:
  671.                         windowSurface.fill((0, 0, 0))
  672.                         return                        
  673.             elif hplace == 245:
  674.  
  675.  
  676.                 if event.type == KEYDOWN:
  677.                     if event.key == K_RIGHT:
  678.                         hplace += 55
  679.                     if event.key == K_LEFT:
  680.                         hplace -= 55
  681.                     if event.key == K_SPACE:
  682.                         password.append(5)
  683.                 if event.type == QUIT:
  684.                     Close()
  685.                 if event.type == KEYDOWN:
  686.                     if event.key == K_ESCAPE:
  687.                         Close()
  688.                     if event.key == K_BACKSPACE:
  689.                         windowSurface.fill((0, 0, 0))
  690.                         return
  691.             elif hplace == 300:
  692.  
  693.  
  694.                 if event.type == KEYDOWN:
  695.                     if event.key == K_RIGHT:
  696.                         hplace += 55
  697.                     if event.key == K_LEFT:
  698.                         hplace -= 55
  699.                     if event.key == K_SPACE:
  700.                         password.append(6)
  701.                 if event.type == QUIT:
  702.                     Close()
  703.                 if event.type == KEYDOWN:
  704.                     if event.key == K_ESCAPE:
  705.                         Close()
  706.                     if event.key == K_BACKSPACE:
  707.                         windowSurface.fill((0, 0, 0))
  708.                         return
  709.             elif hplace == 355:
  710.  
  711.  
  712.                 if event.type == KEYDOWN:
  713.                     if event.key == K_RIGHT:
  714.                         hplace += 55
  715.                     if event.key == K_LEFT:
  716.                         hplace -= 55
  717.                     if event.key == K_SPACE:
  718.                         password.append(7)
  719.                 if event.type == QUIT:
  720.                     Close()
  721.                 if event.type == KEYDOWN:
  722.                     if event.key == K_ESCAPE:
  723.                         Close()
  724.                     if event.key == K_BACKSPACE:
  725.                         windowSurface.fill((0, 0, 0))
  726.                         return
  727.             elif hplace == 410:
  728.  
  729.  
  730.                 if event.type == KEYDOWN:
  731.                     if event.key == K_RIGHT:
  732.                         hplace += 55
  733.                     if event.key == K_LEFT:
  734.                         hplace -= 55
  735.                     if event.key == K_SPACE:
  736.                         password.append(8)
  737.                 if event.type == QUIT:
  738.                     Close()
  739.                 if event.type == KEYDOWN:
  740.                     if event.key == K_ESCAPE:
  741.                         Close()
  742.                     if event.key == K_BACKSPACE:
  743.                         windowSurface.fill((0, 0, 0))
  744.                         return
  745.             elif hplace == 465:
  746.  
  747.  
  748.                 if event.type == KEYDOWN:
  749.                     if event.key == K_RIGHT:
  750.                         hplace += 55
  751.                     if event.key == K_LEFT:
  752.                         hplace -= 55
  753.                     if event.key == K_SPACE:
  754.                         password.append(9)
  755.                 if event.type == QUIT:
  756.                     Close()
  757.                 if event.type == KEYDOWN:
  758.                     if event.key == K_ESCAPE:
  759.                         Close()
  760.                     if event.key == K_BACKSPACE:
  761.                         windowSurface.fill((0, 0, 0))
  762.                         return
  763.             elif hplace == 520:
  764.  
  765.  
  766.                 if event.type == KEYDOWN:
  767.                     if event.key == K_RIGHT:
  768.                         hplace += 55
  769.                     if event.key == K_LEFT:
  770.                         hplace -= 55
  771.                     if event.key == K_SPACE:
  772.                         password.append(0)
  773.                 if event.type == QUIT:
  774.                     Close()
  775.                 if event.type == KEYDOWN:
  776.                     if event.key == K_ESCAPE:
  777.                         Close()
  778.                     if event.key == K_BACKSPACE:
  779.                         windowSurface.fill((0, 0, 0))
  780.                         return
  781.             elif hplace == 575:
  782.  
  783.  
  784.                 if event.type == KEYDOWN:
  785.                     if event.key == K_LEFT:
  786.                         hplace -= 55
  787.                     if event.key == K_SPACE:
  788.                         if len(password) != 0:
  789.                             delthing = len(password) - 1
  790.                             password.remove(password[delthing])
  791.                     if event.key == K_RIGHT:
  792.                         hplace = 25
  793.                 if event.type == QUIT:
  794.                     Close()
  795.                 if event.type == KEYDOWN:
  796.                     if event.key == K_ESCAPE:
  797.                         Close()
  798.                     if event.key == K_BACKSPACE:
  799.                         windowSurface.fill((0, 0, 0))
  800.                         return
  801.  
  802.  
  803.  
  804.  
  805.  
  806.         windowSurface.fill(BACKCOLOR)
  807.         num1bdy.centerx= windowSurface.get_rect().left + 25
  808.         num1bdy.centery= windowSurface.get_rect().centery+ 50
  809.         num2bdy.centerx= windowSurface.get_rect().left + 80
  810.         num2bdy.centery= windowSurface.get_rect().centery +50
  811.         num3bdy.centerx= windowSurface.get_rect().left +135
  812.         num3bdy.centery= windowSurface.get_rect().centery  +50
  813.         num4bdy.centerx= windowSurface.get_rect().left +190
  814.         num4bdy.centery= windowSurface.get_rect().centery +50
  815.         num5bdy.centerx= windowSurface.get_rect().left +245
  816.         num5bdy.centery= windowSurface.get_rect().centery +50
  817.         num6bdy.centerx= windowSurface.get_rect().left +300
  818.         num6bdy.centery= windowSurface.get_rect().centery  +50
  819.         num7bdy.centerx= windowSurface.get_rect().left +355
  820.         num7bdy.centery= windowSurface.get_rect().centery +50
  821.         num8bdy.centerx= windowSurface.get_rect().left +410
  822.         num8bdy.centery= windowSurface.get_rect().centery +50
  823.         num9bdy.centerx= windowSurface.get_rect().left +465
  824.         num9bdy.centery= windowSurface.get_rect().centery+50
  825.         num0bdy.centerx= windowSurface.get_rect().left +520
  826.         num0bdy.centery= windowSurface.get_rect().centery +50
  827.         numdelbdy.centerx= windowSurface.get_rect().left +575
  828.         numdelbdy.centery= windowSurface.get_rect().centery +50
  829.  
  830.         numselectionbdy.centerx= windowSurface.get_rect().left + hplace
  831.         numselectionbdy.centery= windowSurface.get_rect().centery +50
  832.         passwordw= str(password).replace('[', '')
  833.         passwordw= str(passwordw).replace(',', ' ')
  834.         passwordw= str(passwordw).replace(']', '')
  835.  
  836.         thepass = passfont.render(str(passwordw), True, (255, 0, 0), (0 , 0 , 0))
  837.         thepassrect = thepass.get_rect()
  838.         thepassrect.centerx= windowSurface.get_rect().centerx
  839.         thepassrect.centery= windowSurface.get_rect().top + 100
  840.         wrongpassmess = wrongpassfont.render('The password you entered is incorrect', True, (255, 0, 0), (0 , 0 , 0))
  841.         rightpassmess = wrongpassfont.render('You Unlocked A-Machine Model A!', True, (255, 255, 0), (0 , 0 , 0))
  842.         wrongpassmessrect = wrongpassmess.get_rect()
  843.         wrongpassmessrect.centerx= windowSurface.get_rect().centerx
  844.         wrongpassmessrect.centery= windowSurface.get_rect().top + 50
  845.  
  846.         windowSurface.blit(num1, num1bdy)
  847.         windowSurface.blit(num2, num2bdy)
  848.         windowSurface.blit(num3, num3bdy)
  849.         windowSurface.blit(num4, num4bdy)
  850.         windowSurface.blit(num5, num5bdy)
  851.         windowSurface.blit(num6, num6bdy)
  852.         windowSurface.blit(num7, num7bdy)
  853.         windowSurface.blit(num8, num8bdy)
  854.         windowSurface.blit(num9, num9bdy)
  855.         windowSurface.blit(num0, num0bdy)
  856.         windowSurface.blit(numdel, numdelbdy)
  857.         windowSurface.blit(numselection, numselectionbdy)
  858.  
  859.  
  860.  
  861.  
  862.         if len(password) == 6:
  863.             windowSurface.blit(thepass, thepassrect)
  864.             pygame.display.update()
  865.             sleep(1)
  866.             password = []
  867.             print passwordw
  868.             if passwordw == "3  5  8  8  5  3":
  869.                 Right = True
  870.                 wrong = False
  871.                 print "hey"
  872.             if passwordw != "3  5  8  8  5  3":
  873.                 Right = False
  874.                 wrong = True
  875.  
  876.         if Right:
  877.             windowSurface.blit(rightpassmess, wrongpassmessrect)
  878.             passyfile = open('passy.roc', 'w')
  879.             passyfile.write('omar')
  880.             passyfile.close()
  881.  
  882.         if wrong:
  883.             windowSurface.blit(wrongpassmess, wrongpassmessrect)
  884.  
  885.         windowSurface.blit(thepass, thepassrect)
  886.         pygame.display.update()
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896. def menu():
  897.     menupos= 1
  898.     play = False
  899.     while True:
  900.         for event in pygame.event.get():
  901.             if event.type == QUIT:
  902.                 Close()
  903.  
  904.             if menupos == 1:
  905.                 if event.type == KEYDOWN:
  906.                     if event.key == K_DOWN:
  907.                         menupos += 1
  908.                     if event.key == K_SPACE:
  909.                         play = True
  910.             elif menupos == 2:
  911.                 if event.type == KEYDOWN:
  912.                     if event.key == K_UP:
  913.                         menupos -= 1
  914.                     if event.key == K_SPACE:
  915.                         hsmenu()
  916.                     if event.key == K_DOWN:
  917.                         menupos += 1
  918.             elif menupos == 3:
  919.                 if event.type == KEYDOWN:
  920.                     if event.key == K_UP:
  921.                         menupos -= 1
  922.                     if event.key == K_SPACE:
  923.                         passmenu()
  924.                     if event.key == K_DOWN:
  925.                         menupos += 1
  926.             elif menupos == 4:
  927.                 if event.type == KEYDOWN:
  928.                     if event.key == K_UP:
  929.                         menupos -= 1
  930.                     if event.key == K_SPACE:
  931.                         Close()
  932.  
  933.         if menupos == 1:
  934.             textstart = basicfont.render('Start Game', True, (255, 0, 0), (0 , 0 , 0))
  935.         else:
  936.             textstart = basicfont.render('Start Game', True, (255, 255, 255), (0, 0 , 0))
  937.  
  938.         if menupos == 2:
  939.             textoption = basicfont.render('High Scores', True, (255, 0, 0), (0 , 0 , 0))
  940.         else:
  941.             textoption = basicfont.render('High Scores', True, (255, 255, 255), (0, 0 , 0))
  942.  
  943.         if menupos == 3:
  944.             textpass = basicfont.render('Password', True, (255, 0, 0), (0 , 0 , 0))
  945.         else:
  946.             textpass = basicfont.render('Password', True, (255, 255, 255), (0, 0 , 0))
  947.  
  948.         if menupos == 4:
  949.             textexit = basicfont.render('Exit', True, (255, 0, 0), (0 , 0 , 0))
  950.         else:
  951.             textexit = basicfont.render('Exit', True, (255, 255, 255), (0, 0 , 0))
  952.  
  953.  
  954.         textstrect = textstart.get_rect()
  955.         textstrect.centerx= windowSurface.get_rect().centerx
  956.         textstrect.centery= windowSurface.get_rect().centery - 60
  957.         textoprect = textoption.get_rect()
  958.         textoprect.centerx= windowSurface.get_rect().centerx
  959.         textoprect.centery= windowSurface.get_rect().centery - 20
  960.         textparect = textpass.get_rect()
  961.         textparect.centerx= windowSurface.get_rect().centerx
  962.         textparect.centery= windowSurface.get_rect().centery + 20
  963.         textexrect = textexit.get_rect()
  964.         textexrect.centerx= windowSurface.get_rect().centerx
  965.         textexrect.centery= windowSurface.get_rect().centery + 60
  966.  
  967.         windowSurface.blit(textstart, textstrect)
  968.         windowSurface.blit(textexit, textexrect)
  969.         windowSurface.blit(textpass, textparect)
  970.         windowSurface.blit(textoption, textoprect)
  971.         pygame.display.update()
  972.         if play == True:
  973.             break
  974.  
  975.  
  976.  
  977.  
  978. def bounce():
  979.     global dobounce
  980.     dobounce = True
  981.     windowSurface.blit(bouncepadr, bouncepadrb)
  982.     windowSurface.blit(bouncepadl, bouncepadlb)
  983.    
  984.    
  985.    
  986.    
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995. pygame.mouse.set_visible(MOUSEAPPEAR)
  996. windowSurface.fill(BACKCOLOR)
  997.  
  998. #________________setting colorkeys_________________:
  999. for a in playerpics:
  1000.     colorkey = a.get_at((0,0))
  1001.     a.set_colorkey(colorkey)
  1002. for a in explosion:
  1003.     colorkey = a.get_at((0,0))
  1004.     a.set_colorkey(colorkey)
  1005. for a in bigexplosion:
  1006.     colorkey = a.get_at((0,0))
  1007.     a.set_colorkey(colorkey)
  1008. for a in attacks:
  1009.     colorkey = a.get_at((0,1))
  1010.     a.set_colorkey(colorkey)
  1011. for a in objects:
  1012.     colorkey = a.get_at((0,0))
  1013.     a.set_colorkey(colorkey)
  1014. for a in explosion:
  1015.     a.set_colorkey(black)
  1016. energy.set_colorkey(black)
  1017. bouncepadr.set_colorkey(black)
  1018. bouncepadl.set_colorkey(black)
  1019. t1bordl.set_colorkey(black)
  1020. t1bordr.set_colorkey(black)
  1021. t2bordl.set_colorkey(black)
  1022. t2bordr.set_colorkey(black)
  1023. t3bordl.set_colorkey(black)
  1024. t3bordr.set_colorkey(black)
  1025. t3ani.set_colorkey(black)
  1026. t3cov.set_colorkey(black)
  1027. t5bordl.set_colorkey(black)
  1028. t5bordr.set_colorkey(black)
  1029. t5flake1.set_colorkey(black)
  1030. t5cov.set_colorkey(black)
  1031. for a in numpad:
  1032.     a.set_colorkey(black)
  1033. for a in ebt:
  1034.     a.set_colorkey(black)
  1035. #setting end:
  1036. def restartduegameoverhahaha():
  1037.     global level, score, bulletspeed, lives, vehiclespeed, choice, energyint, dobounce, Esheildtrue, AEsheildtrue, shieldtime1, shieldtime2, stageiteration, movedirx, st1brick, st2brick, st3brick, st4brick, st5brick
  1038.     st1brick= []
  1039.     st2brick= []
  1040.     st3brick= []
  1041.     st4brick= []
  1042.     st5brick= []
  1043.     score = 1500 * int(level)
  1044.     bulletspeed = 30
  1045.     lives = 20
  1046.     vehiclespeed = 10
  1047.     if carxop:
  1048.         lives = 30
  1049.         vehiclespeed = 14
  1050.     choice = True
  1051.     energyint = 71
  1052.     dobounce = False
  1053.     Esheildtrue = False
  1054.     AEsheildtrue = False
  1055.     shieldtime1 = 0
  1056.     shieldtime2 = 0
  1057.     stageiteration= 0
  1058.     movedirx = 0
  1059.  
  1060. def _initialthings_():
  1061.     global score, las, lasb, moveright, moveleft, go, bulletspeed, notinlaser, level, st1brick, st2brick, st3brick
  1062.     return
  1063.    
  1064. score = 0
  1065. las = False
  1066. lasb = False
  1067. moveright = False
  1068. moveleft = False
  1069. go = False
  1070. bulletspeed = 30
  1071. notinlaser = True
  1072. level = 1
  1073. st1brick= []
  1074. st2brick= []
  1075. st3brick= []
  1076. st4brick= []
  1077. st5brick= []
  1078. st1hp= []
  1079. st1ep= []
  1080. explosionplace= []
  1081. iexplosionplace= []
  1082. bigexplosionplace= []
  1083. y = 0
  1084. lives = 20
  1085. vehiclespeed = 10
  1086. if carxop:
  1087.     lives = 30
  1088.     vehiclespeed = 16
  1089. gameover = False
  1090. trackc= track1
  1091. y= 0
  1092. z= 0
  1093. dashright = dashleft = False
  1094. dasho = False
  1095. dashspeed = 20
  1096. stageiteration= 0
  1097. choice = True
  1098. energyint = 71
  1099. ebt.reverse()
  1100. dobounce = False
  1101. lbouncevalue= 0
  1102. rbouncevalue= 0
  1103. bounceleft = False
  1104. bounceright= False
  1105. menu()
  1106. laserover = True
  1107. charge = False
  1108. chargeiteration= 0
  1109. cshot = False
  1110. clas = False
  1111. clasb = False
  1112. cgo = False
  1113. cspower = 0
  1114. cnotinlaser = True
  1115. t3isthere = False
  1116. choiceh = 0
  1117. choicee = 0
  1118. hx = 0
  1119. ex = 0
  1120. t4isthere = False
  1121. thunderloop = 1
  1122. Esheildtrue = False
  1123. AEsheildtrue = False
  1124. shieldtime1 = 0
  1125. shieldtime2 = 0
  1126. reflection = False
  1127. x= 0
  1128. ActivateAzone = False
  1129. sounds = []
  1130. channelexp = pygame.mixer.Channel(1)
  1131. channellas = pygame.mixer.Channel(3)
  1132.  
  1133.  
  1134. while True :
  1135.     for n in range(3600):
  1136.         t3isthere = False
  1137.         t4isthere = False
  1138.         t5isthere = False
  1139.         dobounce = False
  1140.         if stageiteration == 2:
  1141.             laserover = False
  1142.         while pause == 0:
  1143.             #_______________________buttons_assignment_____________________:
  1144.             for event in pygame.event.get():
  1145.                 if event.type == QUIT:
  1146.                     Close()
  1147.                 if event.type == KEYUP:
  1148.                     if event.key == K_F1:
  1149.                         pause = 1
  1150.                         moveleft = moveright= False
  1151.                     if event.key == K_ESCAPE:
  1152.                         Close()
  1153.         for event in pygame.event.get():
  1154.             if event.type == QUIT:
  1155.                 Close()
  1156.             if event.type == KEYDOWN:
  1157.                 if event.key == K_ESCAPE:
  1158.                     Close()
  1159.                 if gameover == False:
  1160.                     if laserover == False:
  1161.                         if event.key == K_SPACE:
  1162.                             if energyint > 0:
  1163.                                 charge = True
  1164.                            
  1165.                                
  1166.                 if gameover == False:
  1167.                     if event.key == K_LEFT:
  1168.                         if dashleft == False and dashright == False:
  1169.                             moveleft = True
  1170.  
  1171.  
  1172.                     if event.key == K_RIGHT:
  1173.                         if dashleft == False and dashright == False:
  1174.                             moveright = True
  1175.  
  1176.                     if event.key == K_LCTRL:
  1177.                         dasho = False
  1178.  
  1179.                     if dasho == True:
  1180.                         if event.key == K_LEFT:
  1181.                             if dashleft == False and dashright != True:
  1182.                                 moveleft = moveright = False
  1183.                                 dashleft= True
  1184.  
  1185.                         if event.key == K_RIGHT:
  1186.                             if dashleft == False and dashleft != True:
  1187.                                 moveleft = moveright = False
  1188.                                 dashright = True
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.             if event.type == KEYUP:
  1195.                 if event.key == K_DOWN and stageiteration > 1:
  1196.                     Esheildtrue= False
  1197.                     AEsheildtrue= False
  1198.                     chargeiteration= 0
  1199.                 if event.key ==  K_F1:
  1200.                     pause= 0
  1201.  
  1202.                 if gameover == False:
  1203.                     if laserover == False:
  1204.                         if notinlaser == True and energyint > 0 and cshot== False:
  1205.                            
  1206.                             if event.key == K_SPACE:
  1207.                                 las = pygame.mixer.Sound('4.wav')
  1208.                                 channellas.play(las)
  1209.                                 las = True
  1210.                                 go = False
  1211.                                 energyint -= 1
  1212.                                 charge= False
  1213.                                 chargeiteration= 0
  1214.                        
  1215.                         elif cshot == True and energyint > 1 and cnotinlaser == True:
  1216.                             if event.key == K_UP and stageiteration > 1:
  1217.                                 AEsheildtrue = True
  1218.                             else:
  1219.                                 AEsheildtrue = False
  1220.                             if event.key == K_SPACE:
  1221.  
  1222.                                 las = pygame.mixer.Sound('4.wav')
  1223.  
  1224.                                 channellas.play(las)
  1225.                                 clas = True
  1226.                                 cgo = False
  1227.                                 energyint -= 2
  1228.                                 charge= False
  1229.                                 chargeiteration= 0
  1230.                                 cshot = False
  1231.  
  1232.  
  1233.                 if event.key == K_LCTRL:
  1234.  
  1235.                     dasho = False
  1236.                 if event.key == K_LEFT:
  1237.  
  1238.                     moveleft = False
  1239.  
  1240.                 if event.key == K_RIGHT:
  1241.  
  1242.                     moveright = False
  1243.         #__________end_______________:
  1244.        
  1245.  
  1246.         if playerbodies[n].left < 19:
  1247.             moveleft = False
  1248.             dashleft = False
  1249.  
  1250.         if playerbodies[n].right > WINDOWWIDTH - 19:
  1251.             moveright = False
  1252.             dashright= False
  1253.  
  1254.         if moveleft == True:
  1255.             movedirx = movedirx - PLAYERSPEED
  1256.         if moveright == True:
  1257.             movedirx = movedirx + PLAYERSPEED
  1258.  
  1259.  
  1260.            
  1261.         if bounceleft == True:
  1262.             movedirx = movedirx - lbouncevalue
  1263.         if bounceright == True:
  1264.             movedirx = movedirx + rbouncevalue
  1265.  
  1266.  
  1267.  
  1268.         if dashleft == True:
  1269.             movedirx = movedirx - dashspeed
  1270.         if dashright == True:
  1271.             movedirx = movedirx + dashspeed
  1272.            
  1273.  
  1274.  
  1275.  
  1276.         p0b.centerx = windowSurface.get_rect().centerx + movedirx
  1277.         p0b.centery = windowSurface.get_rect().height - 100
  1278.         p1b.centerx = windowSurface.get_rect().centerx + movedirx
  1279.         p1b.centery = windowSurface.get_rect().height - 100
  1280.         p2b.centerx = windowSurface.get_rect().centerx + movedirx
  1281.         p2b.centery = windowSurface.get_rect().height - 100
  1282.         windowSurface.fill(BACKCOLOR)
  1283.         track1b.center = windowSurface.get_rect().center
  1284.  
  1285.  
  1286.         if (level == 1 or level == 2):
  1287.             if level == 1 and stageiteration == 1:
  1288.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1289.                     pygame.mixer.music.stop()
  1290.                 pygame.mixer.music.load(music[0])
  1291.  
  1292.             Track1(track1, track1b)
  1293.             trackc= track1
  1294.            
  1295.         if (level == 3 or level == 4):
  1296.             Track2(track2, track1b)
  1297.             trackc= track2
  1298.             if level == 3 and stageiteration == 1:
  1299.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1300.                     pygame.mixer.music.stop()
  1301.                 pygame.mixer.music.load(music[1])
  1302.             if level == 4 and stageiteration == 1:
  1303.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1304.                     pygame.mixer.music.stop()
  1305.                 pygame.mixer.music.load(music[1])
  1306.  
  1307.         if (level == 5 or level == 6):
  1308.             Track3(track3, track1b)
  1309.             trackc= track3
  1310.             if stageiteration == 1:
  1311.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1312.                     pygame.mixer.music.stop()
  1313.                 pygame.mixer.music.load(music[1])
  1314.  
  1315.            
  1316.         if (level == 7 or level == 8):
  1317.             Track5(track5, track1b, t5flake1bteam)
  1318.             trackc= track5
  1319.             if level == 8 and stageiteration == 1:
  1320.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1321.                     pygame.mixer.music.stop()
  1322.                 pygame.mixer.music.load(music[2])
  1323.             if level == 7 and stageiteration == 1:
  1324.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1325.                     pygame.mixer.music.stop()
  1326.                 pygame.mixer.music.load(music[1])
  1327.         if (level == 9 or level == 10):
  1328.             Track4(track4, track1b)
  1329.             trackc= track4
  1330.             if level == 8 and stageiteration == 1:
  1331.                 if stageiteration == 1 and pygame.mixer.music.get_busy():
  1332.                     pygame.mixer.music.stop()
  1333.                 pygame.mixer.music.load(music[2])
  1334.            
  1335.            
  1336.         if t4isthere == True:
  1337.             if thunderloop > 0 and thunderloop < 11:
  1338.                 thunder1= t4thundl1
  1339.                 thunder2= t4thundr1
  1340.             elif thunderloop > 10 and thunderloop < 21:
  1341.                 thunder1= t4thundl2
  1342.                 thunder2= t4thundr2
  1343.             elif thunderloop > 20 and thunderloop < 31:
  1344.                 thunder1= t4thundl3
  1345.                 thunder2= t4thundr3
  1346.             elif thunderloop > 30:
  1347.                 if thunderloop %20 == 0:
  1348.                     thunder1= t4thundr3
  1349.                     thunder2= t4thundl3
  1350.                     t4thundr3b.top += 48
  1351.                     t4thundl3b.top += 48
  1352.                 elif thunderloop %10 == 0:
  1353.                     thunder1= t4thundl3
  1354.                     thunder2= t4thundr3
  1355.                     t4thundr3b.top += 48
  1356.                     t4thundl3b.top += 48
  1357.  
  1358.             windowSurface.blit(thunder1, t4thundl3b)
  1359.             windowSurface.blit(thunder2, t4thundr3b)              
  1360.                    
  1361.             bounce()
  1362.             thunderloop += 1
  1363.  
  1364.             if t4thundr3b.top > WINDOWHEIGHT:
  1365.                 t4thundr3b.bottom = 0
  1366.                 thunderloop = 0
  1367.             if t4thundl3b.top > WINDOWHEIGHT:
  1368.                 t4thundl3b.bottom = 0
  1369.                 thunderloop = 0
  1370.         windowSurface.blit(playerpics[n], playerbodies[n])
  1371.         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)
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.         if charge== True:
  1378.            
  1379.        
  1380.             laser0b.bottom = p2b.top
  1381.             laser0b.centerx = p2b.centerx
  1382.             laser2b.bottom = p2b.top -4
  1383.             laser2b.centerx = p2b.centerx
  1384.             claser0b.bottom = p2b.top
  1385.             claser0b.centerx = p2b.centerx
  1386.             claser2b.bottom = p2b.top -4
  1387.             claser2b.centerx = p2b.centerx
  1388.             if chargeiteration < 10:
  1389.                 pass
  1390.             elif chargeiteration <= 36:
  1391.                 if chargeiteration in [10, 11, 12, 16, 17, 18, 22, 23, 24, 28, 29, 30, 34, 35, 36]:
  1392.  
  1393.                     windowSurface.blit(laser0, laser0b)
  1394.                 elif chargeiteration in [13, 14, 15, 19, 20, 21, 25, 26, 27, 31, 32, 33]:
  1395.                     windowSurface.blit(laser2, laser2b)
  1396.            
  1397.             elif chargeiteration > 36:
  1398.                 if chargeiteration % 4 == 0 or chargeiteration % 5 == 0:
  1399.                     windowSurface.blit(claser0, claser0b)
  1400.  
  1401.                 else:
  1402.                     windowSurface.blit(claser2, claser2b)
  1403.                 cshot = True
  1404.                    
  1405.            
  1406.             chargeiteration += 1
  1407.  
  1408.         if AEsheildtrue:
  1409.             Esheildtrue= True
  1410.             AEsheildtrue= False
  1411.             chargeiteration= 0
  1412.  
  1413.         if Esheildtrue and stageiteration == 1:
  1414.             Esheildtrue= False
  1415.             AEsheildtrue= False
  1416.             chargeiteration= 0
  1417.            
  1418.  
  1419.  
  1420.  
  1421.         if Esheildtrue:
  1422.             shieldtime2 = time()
  1423.            
  1424.             ESHb.centerx = p2b.centerx
  1425.             if n % 2== 0:
  1426.  
  1427.  
  1428.                 ESHb.top = p2b.top - 2
  1429.                 windowSurface.blit(Eshield[0], ESHb)
  1430.                
  1431.             else:
  1432.                 ESHb.top = p2b.top
  1433.                 windowSurface.blit(Eshield[1], ESHb)
  1434.             if shieldtime2- shieldtime1 > 1:
  1435.                 energyint -= 2
  1436.                 shieldtime1= time()
  1437.                 if energyint <= 2:
  1438.                     Esheildtrue= False
  1439.                
  1440.                
  1441.            
  1442.            
  1443.  
  1444.         if las == True and clas == False:
  1445.  
  1446.             laser0b.centerx = p2b.centerx
  1447.             laser0b.bottom = p2b.top
  1448.             windowSurface.blit(laser0, laser0b)
  1449.             las = False
  1450.             lasb = True
  1451.  
  1452.         elif clas == True :
  1453.  
  1454.             claser0b.centerx = p2b.centerx
  1455.             claser0b.bottom = p2b.top
  1456.             windowSurface.blit(claser0, claser0b)
  1457.             clas = False
  1458.             clasb = True            
  1459.  
  1460.  
  1461.  
  1462.  
  1463.         if lasb == True and go == False:
  1464.             notinlaser = False
  1465.             laser1b.centerx = p2b.centerx
  1466.             laser1b.bottom = p2b.top - 10
  1467.  
  1468.  
  1469.             go = True
  1470.  
  1471.         elif clasb == True and cgo == False:
  1472.             cnotinlaser = False
  1473.             claser1b.centerx = p2b.centerx
  1474.             claser1b.bottom = p2b.top - 10
  1475.  
  1476.                
  1477.  
  1478.             cgo = True
  1479.  
  1480.         if lasb == True and go == True:
  1481.             laser1b.bottom -=  bulletspeed
  1482.             windowSurface.blit(laser1, laser1b)
  1483.          
  1484.  
  1485.         elif clasb == True and cgo == True:
  1486.             claser1b.bottom -=  bulletspeed
  1487.             windowSurface.blit(claser1, claser1b)
  1488.  
  1489.            
  1490.  
  1491.  
  1492.  
  1493.  
  1494.         for a in st1brick:
  1495.             windowSurface.blit(brick, a)
  1496.  
  1497.                
  1498.             if laser1b.colliderect(a):
  1499.                 explosionplace.append(a)
  1500.                 st1brick.remove(a)
  1501.                 laser1b[1]= -35
  1502.                 score += 200
  1503.  
  1504.                  
  1505.             elif claser1b.colliderect(a):
  1506.                 explosionplace.append(a)
  1507.                 cspower += 1
  1508.                 score += 200
  1509.                 st1brick.remove(a)
  1510.                 if cspower == 2:
  1511.                     claser1b[1]= -10035
  1512.                     cspower = 0
  1513.  
  1514.  
  1515.  
  1516.  
  1517.             if playerbodies[n].colliderect(a):
  1518.                 explosionplace.append(a)
  1519.                 st1brick.remove(a)
  1520.                 if not Esheildtrue:
  1521.                     lives -=1
  1522.                 else:
  1523.                     score += 10
  1524.                        
  1525.  
  1526.  
  1527.  
  1528.         for a in st2brick:
  1529.             windowSurface.blit(ibrick, a)
  1530.  
  1531.             if laser1b.colliderect(a):
  1532.                 iexplosionplace.append(a)
  1533.                 laser1b[1]= -1000
  1534.  
  1535.                
  1536.             if claser1b.colliderect(a):
  1537.                 iexplosionplace.append(a)
  1538.                 cspower += 2
  1539.                
  1540.                 if cspower > 1:
  1541.                     claser1b[1]= -1035
  1542.                     cspower = 0
  1543.  
  1544.              
  1545.             if playerbodies[n].colliderect(a):
  1546.                 explosionplace.append(a)
  1547.                 st2brick.remove(a)
  1548.                 if not Esheildtrue:
  1549.                     lives -=3
  1550.                 else:
  1551.                     score += 10
  1552.                     lives -= 2
  1553.  
  1554.         for a in st3brick:
  1555.             windowSurface.blit(hbrick, a)
  1556.  
  1557.             if laser1b.colliderect(a):
  1558.                 iexplosionplace.append(a)
  1559.                 st1brick.append(a)
  1560.                 st3brick.remove(a)
  1561.                 laser1b[1]= -1000
  1562.  
  1563.             elif claser1b.colliderect(a):
  1564.                 if cspower == 1:
  1565.                     iexplosionplace.append(a)
  1566.                     st1brick.append(a)
  1567.                     st3brick.remove(a)
  1568.                     cspower +=1
  1569.                     score += 200
  1570.                    
  1571.  
  1572.                 elif cspower == 0:
  1573.                     iexplosionplace.append(a)
  1574.                     cspower += 2
  1575.                     score += 400
  1576.                     st3brick.remove(a)
  1577.                    
  1578.                
  1579.                
  1580.                 if cspower == 2:
  1581.                     claser1b[1]= -1035
  1582.                     cspower = 0
  1583.  
  1584.  
  1585.             if playerbodies[n].colliderect(a):
  1586.                 iexplosionplace.append(a)
  1587.                 if not Esheildtrue:
  1588.                     lives -=2
  1589.                 else:
  1590.                     score += 10
  1591.                     lives -= 1
  1592.                 st3brick.remove(a)
  1593.  
  1594.         for a in st4brick:
  1595.             windowSurface.blit(sbrick, a)
  1596.  
  1597.             if laser1b.colliderect(a):
  1598.                 explosionplace.append(a)
  1599.                 st4brick.remove(a)
  1600.                 laser1b[1]= -35
  1601.                 score += 150
  1602.  
  1603.             elif claser1b.colliderect(a):
  1604.                 explosionplace.append(a)
  1605.                 st4brick.remove(a)
  1606.                 cspower += 1
  1607.                 score += 350
  1608.                 if cspower == 2:
  1609.                     claser1b[1]= -35
  1610.                     cspower = 0
  1611.  
  1612.             if playerbodies[n].colliderect(a):
  1613.                 explosionplace.append(a)
  1614.                 st4brick.remove(a)
  1615.                 if not Esheildtrue:
  1616.                     lives -=1
  1617.                 else:
  1618.                     score += 10
  1619.  
  1620.  
  1621.         for a in st5brick:
  1622.             windowSurface.blit(rbrick, a)
  1623.             if laser1b.colliderect(a) or claser1b.colliderect(a):
  1624.                 reflection = True
  1625.  
  1626.             elif claser1b.colliderect(a):
  1627.                 reflection = True
  1628.  
  1629.             if playerbodies[n].colliderect(a):
  1630.                 explosionplace.append(a)
  1631.                 st5brick.remove(a)
  1632.                 if not Esheildtrue:
  1633.                     lives -=1
  1634.                 else:
  1635.                     score += 10
  1636.  
  1637.  
  1638.         for a in st1hp:
  1639.             windowSurface.blit(hp, a)
  1640.  
  1641.             if laser1b.colliderect(a):
  1642.                 explosionplace.append(a)
  1643.                 st1hp.remove(a)
  1644.                 score += 1000
  1645.                 laser1b[1]= -35
  1646.                
  1647.             if claser1b.colliderect(a):
  1648.                 explosionplace.append(a)
  1649.                 st1hp.remove(a)
  1650.                 cspower += 1
  1651.                 score += 1000
  1652.                 if cspower == 2:
  1653.                     claser1b[1]= -1035
  1654.                     cspower = 0
  1655.  
  1656.             if playerbodies[n].colliderect(a):
  1657.                 st1hp.remove(a)
  1658.                 lives += 3
  1659.  
  1660.         for a in st1ep:
  1661.             windowSurface.blit(ep, a)
  1662.  
  1663.             if laser1b.colliderect(a):
  1664.                 explosionplace.append(a)
  1665.                 st1ep.remove(a)
  1666.                 score += 1000
  1667.                 laser1b[1]= -35
  1668.                
  1669.             if claser1b.colliderect(a):
  1670.                 explosionplace.append(a)
  1671.                 st1ep.remove(a)
  1672.                 cspower += 1
  1673.                 score += 1000
  1674.                 if cspower == 2:
  1675.                     claser1b[1]= -1035
  1676.                     cspower = 0
  1677.  
  1678.             if playerbodies[n].colliderect(a):
  1679.                 st1ep.remove(a)
  1680.                 if energyint < 62:
  1681.                     energyint += 10
  1682.                 else:
  1683.                     energyint = 71
  1684.                    
  1685.         if playerbodies[n].colliderect(laser1b):
  1686.             explosionplace.append(playerbodies[n])
  1687.             laser1b.top = WINDOWHEIGHT +1000
  1688.             if not Esheildtrue:
  1689.                 lives -=1
  1690.             else:
  1691.                 score += 10
  1692.  
  1693.         if playerbodies[n].colliderect(claser1b):
  1694.             explosionplace.append(playerbodies[1])
  1695.             claser1b.top = WINDOWHEIGHT +1000
  1696.             cspower = 0
  1697.             if not Esheildtrue:
  1698.                 lives -=2
  1699.             else:
  1700.                 lives -=1            
  1701.  
  1702.         if playerbodies[n].colliderect(bouncepadrb) and dobounce == True:
  1703.             bounceleft = True
  1704.             lbouncevalue= 30
  1705.  
  1706.         if playerbodies[n].colliderect(bouncepadlb) and dobounce == True:
  1707.             bounceright = True
  1708.             rbouncevalue= 30
  1709.  
  1710.         if bounceleft == True:
  1711.             if lbouncevalue > 0:
  1712.                 lbouncevalue -= 1
  1713.             else:
  1714.                 lbouncevalue= 0
  1715.                 bounceleft = False  
  1716.  
  1717.  
  1718.         if bounceright == True:
  1719.             if rbouncevalue > 0:
  1720.                 rbouncevalue -= 1
  1721.             else:
  1722.                 rbouncevalue= 0
  1723.                 bounceright = False
  1724.  
  1725.         #A-zone activation            
  1726.         if stageiteration == 2500:
  1727.             ActivateAzone = True
  1728.  
  1729.         if ActivateAzone == True:
  1730.            
  1731.             windowSurface.blit(AZone, AZoneb)
  1732.             AZoneb[1] = AZoneb[1] + vehiclespeed
  1733.             if AZoneb.top >= playerbodies[n].top:
  1734.                 pygame.time.delay(250)
  1735.                 vehiclespeed += 3
  1736.                 PLAYERSPEED += 3
  1737.                 AZoneb = AZone.get_rect()
  1738.                 AZoneb.centerx = windowSurface.get_rect().centerx
  1739.                 AZoneb.centery = -25
  1740.                 ActivateAzone = False      
  1741.  
  1742.                
  1743.                
  1744.                
  1745.  
  1746.  
  1747.                
  1748.            
  1749.         while lives < 1 :
  1750.             pygame.mixer.stop()
  1751.  
  1752.             for event in pygame.event.get():
  1753.                 if event.type == QUIT:
  1754.                     Close()
  1755.                 if event.type == KEYUP:
  1756.                     moveleft = moveright= False
  1757.                     if event.key == K_ESCAPE:
  1758.                         Close()
  1759.             bulletspeed += 30
  1760.             vehiclespeed= 0
  1761.             windowSurface.fill(BACKCOLOR)
  1762.             gameover = True
  1763.  
  1764.             for a in st1brick:
  1765.                 windowSurface.blit(brick, a)
  1766.                 pygame.display.flip()    
  1767.             for a in bigexplosion:
  1768.                 windowSurface.fill(BACKCOLOR)
  1769.                 windowSurface.blit(bigexplosion[z], playerbodies[n])
  1770.                 z +=1
  1771.                 exlsound = pygame.mixer.Sound('7.wav')
  1772.                 exlsound.play()
  1773.                 pygame.display.flip()
  1774.                 if z == 10:
  1775.                     while z == 10:
  1776.                         windowSurface.fill(BACKCOLOR)
  1777.                         for d in st1brick:
  1778.                             windowSurface.blit(brick, d)
  1779.                             pygame.display.flip()
  1780.                             pygame.time.delay(20)
  1781.                             for event in pygame.event.get():
  1782.                                 if event.type == QUIT:
  1783.                                     Close()
  1784.                                 if event.type == KEYUP:
  1785.                                     moveleft = moveright= False
  1786.                                     if event.key == K_ESCAPE:
  1787.                                         Close()
  1788.                         try:
  1789.                             _score_ = ''
  1790.                             scrtxtd= []
  1791.                             scrtxte= []
  1792.                             ASC_VAL= 0
  1793.                             chkscrtxt = open('HighScores.man', 'r')
  1794.                             scrtxteb= chkscrtxt.readlines()
  1795.                             for c in range(len(scrtxteb)):
  1796.                                 scrtxte.append(scrtxteb[c].rstrip('\n'))
  1797.  
  1798.                                
  1799.                            
  1800.                                
  1801.                             for c in scrtxte:
  1802.                                 _score_ = ''
  1803.                                 for symb in c:
  1804.                                     ASC_VAL = ord(symb)
  1805.                                     ASC_VAL -= crypo
  1806.                                     if ASC_VAL > 126:
  1807.                                         ASC_VAL -= 94
  1808.                                     if ASC_VAL < 32:
  1809.                                         ASC_VAL += 94
  1810.                                     _score_  += chr(ASC_VAL)
  1811.                                
  1812.                                 scrtxtd.append(_score_)
  1813.                             chkscrtxt.close()
  1814.                             _score_ = ''
  1815.                            
  1816.                             for sn in range(10):
  1817.                            
  1818.                                 if score > int(scrtxtd[sn]):
  1819.  
  1820.                                     chkscrtxt = open('HighScores.man', 'w')
  1821.                                     for symb in str(score):
  1822.                                         ASC_VAL = ord(symb)
  1823.                                         ASC_VAL += crypo
  1824.                                         if ASC_VAL > 126:
  1825.                                             ASC_VAL -= 94
  1826.                                         if ASC_VAL < 32:
  1827.                                             ASC_VAL += 94
  1828.                                         _score_  += chr(ASC_VAL)
  1829.                                     scrtxteb[sn]= _score_ + '\n'
  1830.                                     chkscrtxt.writelines(scrtxteb)
  1831.                                     scrtxteb= []
  1832.                                     chkscrtxt.close()
  1833.  
  1834.                                        
  1835.                                
  1836.                            
  1837.  
  1838.  
  1839.                             for c in range(256):
  1840.                                 windowSurface.fill(BACKCOLOR)
  1841.                                 gameoverfont = threetwoone.render('GAME OVER', True, (c, c, c), (0, 0 , 0))
  1842.                                 gameoverfontb= gameoverfont.get_rect()
  1843.                                 gameoverfontb.centery= windowSurface.get_rect().centery
  1844.                                 gameoverfontb.centerx= windowSurface.get_rect().centerx
  1845.                                 windowSurface.blit(gameoverfont, gameoverfontb)
  1846.                                 pygame.display.flip()
  1847.                                 pygame.time.delay(10)
  1848.  
  1849.                                 if c == 255:
  1850.                                     sleep(2)
  1851.                                     gameover = False
  1852.                                     restartduegameoverhahaha()
  1853.                                     z = 0
  1854.                                    
  1855.                                     for event in pygame.event.get():
  1856.                                         if event.type == QUIT:
  1857.                                             Close()
  1858.                                         if event.type == KEYUP:
  1859.                                             moveleft = moveright= False
  1860.                                             if event.key == K_ESCAPE:
  1861.                                                 Close()
  1862.                                 for event in pygame.event.get():
  1863.                                     if event.type == QUIT:
  1864.                                         Close()
  1865.                                     if event.type == KEYUP:
  1866.                                         moveleft = moveright= False
  1867.                                         if event.key == K_ESCAPE:
  1868.                                             Close()
  1869.  
  1870.                         except:
  1871.                             for c in range(256):
  1872.                                 windowSurface.fill(BACKCOLOR)
  1873.                                 gameoverfont = threetwoone.render('GAME OVER', True, (c, c, c), (0, 0 , 0))
  1874.                                 gameoverfontb= gameoverfont.get_rect()
  1875.                                 gameoverfontb.centery= windowSurface.get_rect().centery
  1876.                                 gameoverfontb.centerx= windowSurface.get_rect().centerx
  1877.                                 windowSurface.blit(gameoverfont, gameoverfontb)
  1878.                                 pygame.display.flip()
  1879.                                 pygame.time.delay(10)
  1880.  
  1881.                                 if c == 255:
  1882.                                     sleep(2)
  1883.                                     gameover = False
  1884.                                     restartduegameoverhahaha()
  1885.                                     z = 0
  1886.                                    
  1887.                                     for event in pygame.event.get():
  1888.                                         if event.type == QUIT:
  1889.                                             Close()
  1890.                                         if event.type == KEYUP:
  1891.                                             moveleft = moveright= False
  1892.                                             if event.key == K_ESCAPE:
  1893.                                                 Close()
  1894.                                 for event in pygame.event.get():
  1895.                                     if event.type == QUIT:
  1896.                                         Close()
  1897.                                     if event.type == KEYUP:
  1898.                                         moveleft = moveright= False
  1899.                                         if event.key == K_ESCAPE:
  1900.                                             Close()
  1901.                            
  1902.                                
  1903.                 Clock.tick(30)
  1904.  
  1905.  
  1906.  
  1907.         for a in st1brick:
  1908.  
  1909.             if a[1] > WINDOWHEIGHT:
  1910.                 st1brick.remove(a)
  1911.  
  1912.         for b in range(len(st1brick)):
  1913.             st1brick[b][1] = st1brick[b][1] + vehiclespeed
  1914.  
  1915.         for a in st4brick:
  1916.  
  1917.             if a[1] > WINDOWHEIGHT:
  1918.                 st4brick.remove(a)
  1919.  
  1920.         for b in range(len(st4brick)):
  1921.             st4brick[b][1] = st4brick[b][1] + vehiclespeed
  1922.  
  1923.         for a in st2brick:
  1924.  
  1925.             if a[1] > WINDOWHEIGHT:
  1926.                 st2brick.remove(a)
  1927.  
  1928.         for b in range(len(st2brick)):
  1929.             st2brick[b][1] = st2brick[b][1]+ vehiclespeed
  1930.  
  1931.  
  1932.         for a in st3brick:
  1933.  
  1934.             if a[1] > WINDOWHEIGHT:
  1935.                 st3brick.remove(a)
  1936.  
  1937.         for b in range(len(st3brick)):
  1938.             st3brick[b][1] = st3brick[b][1] + vehiclespeed
  1939.  
  1940.         for a in st5brick:
  1941.  
  1942.             if a[1] > WINDOWHEIGHT:
  1943.                 st5brick.remove(a)
  1944.  
  1945.         for b in range(len(st5brick)):
  1946.             st5brick[b][1] = st5brick[b][1] + vehiclespeed
  1947.  
  1948.  
  1949.  
  1950.  
  1951.         for a in st1hp:
  1952.  
  1953.             if a[1] > WINDOWHEIGHT:
  1954.                 st1hp.remove(a)
  1955.  
  1956.         for b in range(len(st1hp)):
  1957.             st1hp[b][1] = st1hp[b][1] + vehiclespeed
  1958.  
  1959.         for a in st1ep:
  1960.  
  1961.             if a[1] > WINDOWHEIGHT:
  1962.                 st1ep.remove(a)
  1963.  
  1964.         for b in range(len(st1ep)):
  1965.             st1ep[b][1] = st1ep[b][1] + vehiclespeed
  1966.  
  1967.         for q in explosionplace:
  1968.             exnsound = pygame.mixer.Sound('7.wav')
  1969.  
  1970.            
  1971.                
  1972.  
  1973.             windowSurface.blit(explosion[y], q)
  1974.             y += 1
  1975.             q[1]= q[1]+8
  1976.  
  1977.             if y == 12:
  1978.                 y = 0
  1979.                 explosionplace.remove(q)
  1980.  
  1981.         for q in iexplosionplace:
  1982.             exnsound = pygame.mixer.Sound('8.wav')
  1983.  
  1984.             windowSurface.blit(explosion[y], q)
  1985.             y += 1
  1986.             q[1]= q[1]
  1987.             if y == 12:
  1988.                 y = 0
  1989.                 iexplosionplace.remove(q)
  1990.  
  1991.         if claser1b.bottom < 0:
  1992.             claser1b[1] = -10000
  1993.             clas = False
  1994.             clasb = False
  1995.             cgo = False
  1996.             cnotinlaser= True
  1997.             cspower = 0
  1998.            
  1999.            
  2000.         if laser1b.bottom < 0:
  2001.             laser1b[1] = -10000
  2002.             las = False
  2003.             lasb = False
  2004.             go = False
  2005.             notinlaser= True
  2006.  
  2007.         if reflection:
  2008.             if laser1b.top > WINDOWHEIGHT :
  2009.                 bulletspeed = 30
  2010.                 las = False
  2011.                 lasb = False
  2012.                 go = False
  2013.                 notinlaser= True
  2014.                 reflection = False
  2015.                
  2016.             elif claser1b.top > WINDOWHEIGHT:
  2017.                 bulletspeed = 30
  2018.                 clas = False
  2019.                 clasb = False
  2020.                 cgo = False
  2021.                 cnotinlaser= True
  2022.                 cspower = 0
  2023.                 reflection = False
  2024.                
  2025.             else:
  2026.                 bulletspeed = -30
  2027.                
  2028.         if t5isthere:
  2029.             windowSurface.blit(t5cov, track1b)
  2030.  
  2031.  
  2032.  
  2033.  
  2034.            
  2035.  
  2036.  
  2037.         if t3isthere:
  2038.             windowSurface.blit(t3cov, track1b)
  2039.             windowSurface.blit(t3ani, t3anib1)
  2040.             windowSurface.blit(t3ani, t3anib2)
  2041.             t3anib1.top += vehiclespeed
  2042.             t3anib2.top += vehiclespeed
  2043.  
  2044.             if t3anib1.top > WINDOWHEIGHT:
  2045.                 t3anib1.bottom = 0
  2046.             if t3anib2.top > WINDOWHEIGHT:
  2047.                 t3anib2.bottom = 0
  2048.  
  2049.  
  2050.  
  2051.             if t3anib1.top > WINDOWHEIGHT:
  2052.                 t3anib1.bottom = 0
  2053.             if t3anib2.top > WINDOWHEIGHT:
  2054.                 t3anib2.bottom = 0
  2055.  
  2056.            
  2057.  
  2058.         textscore = scorefont.render(str(score), False, (255, 0, 0), (0 , 0 , 0))
  2059.         textscorest = scorefont.render('Score:', False, (255, 0, 0), (0 , 0 , 0))
  2060.         textener = basicfont.render(str(lives), False, (0, 200, 255), (0 , 0 , 0))
  2061.         textscrect = textscore.get_rect()
  2062.         textscstrect = textscorest.get_rect()
  2063.         textenerrect= textener.get_rect()
  2064.         textscrect.centerx= windowSurface.get_rect().centerx - 5
  2065.         textscstrect.centerx= windowSurface.get_rect().centerx - 115
  2066.         textscrect.centery= windowSurface.get_rect().top + 25
  2067.         textscstrect.centery= windowSurface.get_rect().top + 25
  2068.         textenerrect.centerx= windowSurface.get_rect().centerx - 200
  2069.         textenerrect.centery= windowSurface.get_rect().top + 25
  2070.         energyb.centerx= windowSurface.get_rect().centerx - 250
  2071.         energyb.centery= windowSurface.get_rect().top + 25
  2072.  
  2073.         textscore.set_colorkey(black)
  2074.         textscorest.set_colorkey(black)
  2075.         textener.set_colorkey(black)
  2076.         windowSurface.blit(textscore, textscrect)
  2077.         windowSurface.blit(textscorest, textscstrect)
  2078.         windowSurface.blit(textener, textenerrect)
  2079.         windowSurface.blit(energy, energyb)
  2080.         windowSurface.blit(ebt[energyint], eb1b)
  2081.  
  2082.         if level == 11:
  2083.             passcodeimg = pygame.image.load("passed.bmp")
  2084.             passcodeimgb= passcodeimg.get_rect()
  2085.             passcodeimgb.center = windowSurface.get_rect().center
  2086.             while True:
  2087.                 windowSurface.blit(passcodeimg, passcodeimgb)
  2088.                 for event in pygame.event.get():
  2089.                     if event.type == QUIT:
  2090.                         Close()
  2091.                     if event.type == KEYUP:
  2092.                         moveleft = moveright= False
  2093.                         if event.key == K_ESCAPE:
  2094.                             Close()
  2095.                 pygame.display.update()
  2096.  
  2097.         #3-2-1 go
  2098.         if stageiteration == 2:
  2099.             pygame.mixer.music.stop()
  2100.             pygame.mixer.music.play(-1, 12.0)
  2101.             vehiclespeed = 10
  2102.             PLAYERSPEED  = 9
  2103.             windowSurface.fill(BACKCOLOR)
  2104.             three = threetwoone.render('3', False, (255, 0, 0), (0, 0 , 0))
  2105.             threeb = three.get_rect()
  2106.             threeb.center = windowSurface.get_rect().center
  2107.             three.set_colorkey(black)
  2108.             p.set_colorkey(black)
  2109.             windowSurface.blit(trackc, track1b)
  2110.             windowSurface.blit(p, playerbodies[n])
  2111.             textscore.set_colorkey(black)
  2112.             textscorest.set_colorkey(black)
  2113.             textener.set_colorkey(black)
  2114.             windowSurface.blit(textscore, textscrect)
  2115.             windowSurface.blit(textscorest, textscstrect)
  2116.             windowSurface.blit(textener, textenerrect)
  2117.             windowSurface.blit(energy, energyb)
  2118.             windowSurface.blit(three, threeb)
  2119.             windowSurface.blit(ebt[energyint], eb1b)
  2120.             pygame.display.update()
  2121.             sleep(2)
  2122.             windowSurface.fill(BACKCOLOR)
  2123.             two = threetwoone.render('2', False, (0, 255, 0), (0, 0 , 0))
  2124.             two.set_colorkey(black)
  2125.             p.set_colorkey(black)
  2126.             windowSurface.blit(trackc, track1b)
  2127.             windowSurface.blit(p, playerbodies[n])
  2128.             textscore.set_colorkey(black)
  2129.             textscorest.set_colorkey(black)
  2130.             textener.set_colorkey(black)
  2131.             windowSurface.blit(textscore, textscrect)
  2132.             windowSurface.blit(textscorest, textscstrect)
  2133.             windowSurface.blit(textener, textenerrect)
  2134.             windowSurface.blit(energy, energyb)
  2135.             windowSurface.blit(two, threeb)
  2136.             windowSurface.blit(ebt[energyint], eb1b)
  2137.             pygame.display.update()
  2138.             sleep(2)
  2139.             windowSurface.fill(BACKCOLOR)
  2140.             one = threetwoone.render('1', False, (0, 0, 255), (0, 0 , 0))
  2141.             one.set_colorkey(black)
  2142.             p.set_colorkey(black)
  2143.             windowSurface.blit(trackc, track1b)
  2144.             windowSurface.blit(p, playerbodies[n])
  2145.             textscore.set_colorkey(black)
  2146.             textscorest.set_colorkey(black)
  2147.             textener.set_colorkey(black)
  2148.             windowSurface.blit(textscore, textscrect)
  2149.             windowSurface.blit(textscorest, textscstrect)
  2150.             windowSurface.blit(textener, textenerrect)
  2151.             windowSurface.blit(energy, energyb)
  2152.             windowSurface.blit(one, threeb)
  2153.             windowSurface.blit(ebt[energyint], eb1b)
  2154.             pygame.display.update()
  2155.             sleep(2)
  2156.             windowSurface.fill(BACKCOLOR)
  2157.             gowrite = gosys.render('GO!', False, (255, 255, 255), (0, 0 , 0))
  2158.             gowriteb= gowrite.get_rect()
  2159.             gowriteb.center = windowSurface.get_rect().center
  2160.             gowrite.set_colorkey(black)
  2161.             p.set_colorkey(black)
  2162.             windowSurface.blit(trackc, track1b)
  2163.             windowSurface.blit(p, playerbodies[n])
  2164.             textscore.set_colorkey(black)
  2165.             textscorest.set_colorkey(black)
  2166.             textener.set_colorkey(black)
  2167.             windowSurface.blit(textscore, textscrect)
  2168.             windowSurface.blit(textscorest, textscstrect)
  2169.             windowSurface.blit(textener, textenerrect)
  2170.             windowSurface.blit(energy, energyb)
  2171.             windowSurface.blit(gowrite, gowriteb)
  2172.             windowSurface.blit(ebt[energyint], eb1b)
  2173.             pygame.display.update()
  2174.             sleep(1)
  2175.            
  2176.        #3-2-1 go_end
  2177.         Clock.tick(carspeed)
  2178.         Clock.tick(FPS)      
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.         score += 1
  2186.         dobounce = False
  2187.  
  2188.         pygame.display.update()
  2189.  
  2190.  
  2191.  
  2192. #######################################################################################################
  2193. #levels.py
  2194. ######################################################################################################
  2195.  
  2196.  
  2197.  
  2198. import pygame
  2199. from pygame.locals import *
  2200. from time import *
  2201. def levels_dat(windowSurface, brickbody,  hbrickbody
  2202.                , sbrickbody, ibrickbody,  rbrickbody
  2203.                , epbody ,  hpbody,    stageiteration
  2204.                , st1brick,st2brick,st3brick,st4brick
  2205.                , st5brick, st1hp , x , level , lives
  2206.                , energyint,movedirx,st1ep,black,basicfont):
  2207.     choiceh = None
  2208.     choicee = None
  2209.     choice1 = None
  2210.     choice2 = None
  2211.     choice3 = None
  2212.     choice4 = None
  2213.     choice5 = None
  2214.     hx = 0
  2215.     ex = 0
  2216.    
  2217. #_______________________stage 1______________________
  2218.     stageiteration += 1
  2219.     if stageiteration == 2000:
  2220.         st1brick= []
  2221.         st2brick= []
  2222.         st3brick= []
  2223.         st4brick= []
  2224.         st5brick= []
  2225.     if  stageiteration % 100 == 0 and level == 1 and stageiteration < 2001:
  2226.         if stageiteration in [100, 400, 700, 1000, 1300, 1700, 2000]:
  2227.             x = -55
  2228.         if stageiteration in [200, 500, 800, 1100, 1400, 1800]:
  2229.             x = -200
  2230.         if stageiteration in [300, 600, 900, 1200, 1500, 1900]:
  2231.             x = 90
  2232.         brickbody.top = windowSurface.get_rect().top
  2233.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2234.         hpbody.top = windowSurface.get_rect().top
  2235.         hpbody.centerx = windowSurface.get_rect().centerx + x
  2236.         hpb = list(hpbody)
  2237.         brickb = list(brickbody)
  2238.         brickb2 = list(brickbody)
  2239.         brickb2[0] = brickb2[0]+ 110
  2240.         st1brick.append(brickb)
  2241.         st1brick.append(brickb2)
  2242.  
  2243. #stage 1.5
  2244.     x = 0
  2245.     if  stageiteration % 80 == 0 and level == 1 and stageiteration > 2000:
  2246.  
  2247.         if stageiteration in [2080, 2320, 2560, 2800, 3040, 3280, 3520, 3760, 4000]:
  2248.             x = -200
  2249.         if stageiteration in [2160, 2400, 2640, 2880, 3120, 3360, 3600, 3840]:
  2250.             x = -55
  2251.         if stageiteration in [2240, 2480, 2720, 2960, 3200, 3440, 3680, 3920]:
  2252.             x = 90
  2253.         brickbody.top = windowSurface.get_rect().top
  2254.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2255.         brickb = list(brickbody)
  2256.         brickb2 = list(brickbody)
  2257.  
  2258.         brickb2[0] = brickb2[0]+ 110
  2259.         st1brick.append(brickb)
  2260.         st1brick.append(brickb2)
  2261.  
  2262.     if stageiteration == 4001 and level== 1:
  2263.         level = 2
  2264.         stageiteration = 0
  2265.         windowSurface.fill(black)
  2266.         textstage2 = basicfont.render('stage 2', True, (255, 255, 255), (0 , 0 , 0))
  2267.         tstage2rect= textstage2.get_rect()
  2268.         tstage2rect.centerx = windowSurface.get_rect().centerx
  2269.         tstage2rect.centery = windowSurface.get_rect().centery
  2270.         windowSurface.blit(textstage2, tstage2rect)
  2271.         pygame.display.update()
  2272.         sleep(3)
  2273.         level= 2
  2274.         lives = 20
  2275.         movedirx = 0
  2276.         energyint = 71
  2277.     #stage 1_end
  2278.  
  2279.  
  2280.  
  2281. #____________________stage 2_____________________
  2282.  
  2283.     if stageiteration % 80 == 0 and level == 2 and stageiteration < 2001:
  2284.         x = 0
  2285.         if stageiteration in [320, 400, 720, 880, 1440, 1760]:
  2286.             x = -150
  2287.             choice2 = True
  2288.         if stageiteration in [80, 560, 1120, 1360, 1840]:
  2289.             x = 0
  2290.             choice2 = True
  2291.         if stageiteration in [160, 480, 960, 1200, 1600, 1680]:
  2292.             x = 150
  2293.             choice2 = True
  2294.         if stageiteration in [240, 640, 1040, 1280]:
  2295.             choice2 = False
  2296.             x = 80
  2297.         if stageiteration in [800, 1520, 1920, 2000]:
  2298.             choice2 = False
  2299.             x = -80
  2300.         brickbody.top = windowSurface.get_rect().top
  2301.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2302.         brickb = list(brickbody)
  2303.         brickb2 = list(brickbody)
  2304.         brickb2[0] = brickb2[0]+ 110
  2305.         brickb3 = list(brickbody)
  2306.         brickb3[0] = brickb3[0]- 110
  2307.         st1brick.append(brickb)
  2308.         st1brick.append(brickb2)
  2309.  
  2310.         if choice2== True:
  2311.             st1brick.append(brickb3)
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320. #stage 2.5
  2321.     if stageiteration % 80 == 0 and level == 2 and stageiteration > 2000:
  2322.         x = 0
  2323.         if stageiteration in [2320, 2400, 2720, 2880, 3440, 3760]:
  2324.             x = -150
  2325.             choice2 = True
  2326.         if stageiteration in [2080, 2560, 3120, 3360, 3840]:
  2327.             x = 0
  2328.             choice2 = False
  2329.         if stageiteration in [2160, 2480, 2960, 3200, 3600, 3680]:
  2330.             x = 150
  2331.             choice2 = True
  2332.         if stageiteration in [240, 2640, 3040, 3280]:
  2333.             choice = False
  2334.             x = 80
  2335.         if stageiteration in [2800, 3520, 3920, 4000]:
  2336.             choice2 = False
  2337.             x = -80
  2338.         hbrickbody.top = windowSurface.get_rect().top
  2339.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2340.         hbrickb = list(hbrickbody)
  2341.         hbrickb2 = list(hbrickbody)
  2342.         hbrickb2[0] = hbrickb2[0]+ 110
  2343.         hbrickb3 = list(hbrickbody)
  2344.         hbrickb3[0] = hbrickb3[0]- 110
  2345.         brickbody.top = windowSurface.get_rect().top
  2346.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2347.         brickb = list(brickbody)
  2348.         brickb2 = list(brickbody)
  2349.         brickb2[0] = brickb2[0]+ 110
  2350.         brickb3 = list(brickbody)
  2351.         brickb3[0] = brickb3[0]- 110
  2352.  
  2353.  
  2354.         if choice2 == True:
  2355.             st3brick.append(hbrickb)
  2356.             st3brick.append(hbrickb2)
  2357.             st3brick.append(hbrickb3)
  2358.         if choice2 == False:
  2359.             st1brick.append(brickb)
  2360.             st1brick.append(brickb2)
  2361.             st1brick.append(brickb3)
  2362.     if stageiteration == 4001 and level== 2:
  2363.         level = 3
  2364.         stageiteration = 0
  2365.         windowSurface.fill(black)
  2366.         textstage2 = basicfont.render('stage 3', True, (255, 255, 255), (0 , 0 , 0))
  2367.         tstage2rect= textstage2.get_rect()
  2368.         tstage2rect.centerx = windowSurface.get_rect().centerx
  2369.         tstage2rect.centery = windowSurface.get_rect().centery
  2370.         windowSurface.blit(textstage2, tstage2rect)
  2371.         pygame.display.update()
  2372.         sleep(3)
  2373.         lives = 20
  2374.         movedirx = 0
  2375.         energyint = 71
  2376.     #stage 2_end
  2377.  
  2378. #____________________stage 3_____________________
  2379.  
  2380.     if stageiteration % 80 == 0 and level == 3 and stageiteration < 2001:
  2381.         x = 0
  2382.         if stageiteration in [80, 560, 1120, 1360, 1840]:
  2383.             x = -150
  2384.             choice2 = True
  2385.         if stageiteration in [160, 480, 960, 1200, 1600, 1680]:
  2386.             x = 0
  2387.             choice2 = False
  2388.         if stageiteration in [240, 640, 1040, 1280]:
  2389.             x = 150
  2390.             choice2 = True
  2391.         if stageiteration in [320, 400, 720, 880, 1440, 1760]:
  2392.             choice2 = False
  2393.             x = 70
  2394.         if stageiteration in [800, 1520, 1920, 2000]:
  2395.             choice2 = True
  2396.             x = -70
  2397.         hbrickbody.top = windowSurface.get_rect().top
  2398.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2399.         hbrickb = list(hbrickbody)
  2400.         hbrickb2 = list(hbrickbody)
  2401.         hbrickb2[0] = hbrickb2[0]+ 110
  2402.         hbrickb3 = list(hbrickbody)
  2403.         hbrickb3[0] = hbrickb3[0]- 110
  2404.         brickbody.top = windowSurface.get_rect().top
  2405.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2406.         brickb = list(brickbody)
  2407.         brickb2 = list(brickbody)
  2408.         brickb2[0] = brickb2[0]+ 110
  2409.         brickb3 = list(brickbody)
  2410.         brickb3[0] = brickb3[0]- 110
  2411.        
  2412.  
  2413.         if choice2 == True:
  2414.             st3brick.append(hbrickb)
  2415.             st3brick.append(hbrickb2)
  2416.             st3brick.append(hbrickb3)
  2417.         if choice2 == False:
  2418.             st1brick.append(brickb)
  2419.             st1brick.append(brickb2)
  2420.             st1brick.append(brickb3)
  2421. #stage 3.5
  2422.     if stageiteration % 80 == 0 and level == 3 and stageiteration > 2000:
  2423.         x = 0
  2424.         if stageiteration in [2320, 2400, 2720, 2880, 3440, 3760]:
  2425.             x = -150
  2426.             choice2 = True
  2427.             choice3 = False
  2428.         if stageiteration in [2080, 2560, 3120, 3360, 3840]:
  2429.             x = 0
  2430.             choice3 = True
  2431.             choice2 = False
  2432.         if stageiteration in [2160, 2480, 2960, 3200, 3600, 3680]:
  2433.             x = 150
  2434.             choice2 = True
  2435.             choice3 = False
  2436.         if stageiteration in [2240, 2640, 3040, 3280]:
  2437.             choice3 = True
  2438.             choice2 = False
  2439.             x = 80
  2440.         if stageiteration in [2800, 3520, 3920, 4000]:
  2441.             choice3 = True
  2442.             choice2 = False
  2443.             x = -80
  2444.         hbrickbody.top = windowSurface.get_rect().top
  2445.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2446.         hbrickb = list(hbrickbody)
  2447.         hbrickb2 = list(hbrickbody)
  2448.         hbrickb2[0] = hbrickb2[0]+ 110
  2449.         hbrickb3 = list(hbrickbody)
  2450.         hbrickb3[0] = hbrickb3[0]- 110
  2451.         brickbody.top = windowSurface.get_rect().top
  2452.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2453.         brickb = list(brickbody)
  2454.         brickb2 = list(brickbody)
  2455.         brickb2[0] = brickb2[0]+ 110
  2456.         brickb3 = list(brickbody)
  2457.         brickb3[0] = brickb3[0]- 110
  2458.         sbrickbody.top = windowSurface.get_rect().top
  2459.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2460.         sbrickb = list(sbrickbody)
  2461.         sbrickb2 = list(sbrickbody)
  2462.         sbrickb2[0] = sbrickb2[0]+ 64
  2463.         sbrickb3 = list(sbrickbody)
  2464.         sbrickb3[0] = sbrickb3[0]- 64
  2465.         sbrickb4 = list(sbrickbody)
  2466.         sbrickb4[0] = sbrickb4[0]- 128
  2467.         sbrickb5 = list(sbrickbody)
  2468.         sbrickb5[0] = sbrickb5[0]+ 128
  2469.  
  2470.         if choice2:
  2471.             st3brick.append(hbrickb)
  2472.             st3brick.append(hbrickb2)
  2473.             st3brick.append(hbrickb3)
  2474.         if choice3:
  2475.             st4brick.append(sbrickb)
  2476.             st4brick.append(sbrickb2)
  2477.             st4brick.append(sbrickb3)
  2478.             st4brick.append(sbrickb4)
  2479.             st4brick.append(sbrickb5)
  2480.     if stageiteration == 4001 and level== 3:
  2481.         level = 4
  2482.         stageiteration = 0
  2483.         windowSurface.fill(black)
  2484.         textstage2 = basicfont.render('stage 4', True, (255, 255, 255), (0 , 0 , 0))
  2485.         tstage2rect= textstage2.get_rect()
  2486.         tstage2rect.centerx = windowSurface.get_rect().centerx
  2487.         tstage2rect.centery = windowSurface.get_rect().centery
  2488.         windowSurface.blit(textstage2, tstage2rect)
  2489.         pygame.display.update()
  2490.         sleep(3)
  2491.         lives = 20
  2492.         movedirx = 0
  2493.         energyint = 71
  2494.     #stage 3_end
  2495. #____________________stage 4_____________________:
  2496.     if stageiteration % 80 == 0 and level == 4 and stageiteration < 2001:
  2497.         if stageiteration in [320, 400, 720, 880, 1440, 1760]:
  2498.             x = -155
  2499.             choice1 = True
  2500.             choice2 = False
  2501.         if stageiteration in [80, 560, 1120, 1360, 1840]:
  2502.             x = 0
  2503.             choice1 = True
  2504.             choice2 = False
  2505.         if stageiteration in [160, 480, 960, 1200, 1600, 1680]:
  2506.             x = 40
  2507.             choice1 = True
  2508.             choice2 = False
  2509.         if stageiteration in [240, 640, 1040, 1280]:
  2510.             choice2 = True
  2511.             choice1 = False
  2512.             x = 80
  2513.         if stageiteration in [800, 1520, 1920, 2000]:
  2514.             choice2 = True
  2515.             choice1 = False
  2516.             x = -75            
  2517.  
  2518.         hbrickbody.top = windowSurface.get_rect().top
  2519.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2520.         hbrickb = list(hbrickbody)
  2521.         hbrickb2 = list(hbrickbody)
  2522.         hbrickb2[0] = hbrickb2[0]+ 110
  2523.         hbrickb3 = list(hbrickbody)
  2524.         hbrickb3[0] = hbrickb3[0]- 110
  2525.         brickbody.top = windowSurface.get_rect().top
  2526.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2527.         brickb = list(brickbody)
  2528.         brickb2 = list(brickbody)
  2529.         brickb2[0] = brickb2[0]+ 110
  2530.         brickb3 = list(brickbody)
  2531.         brickb3[0] = brickb3[0]- 110
  2532.         brickb4 = list(brickbody)
  2533.         brickb4[0] = brickb4[0]+ 220
  2534.         sbrickbody.top = windowSurface.get_rect().top
  2535.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2536.         sbrickb = list(sbrickbody)
  2537.         sbrickb2 = list(sbrickbody)
  2538.         sbrickb2[0] = sbrickb2[0]+ 64
  2539.         sbrickb3 = list(sbrickbody)
  2540.         sbrickb3[0] = sbrickb3[0]- 64
  2541.         sbrickb4 = list(sbrickbody)
  2542.         sbrickb4[0] = sbrickb4[0]- 128
  2543.         sbrickb5 = list(sbrickbody)
  2544.         sbrickb5[0] = sbrickb5[0]+ 128
  2545.         sbrickb6 = list(sbrickbody)
  2546.         sbrickb6[0] = sbrickb6[0]+ 192
  2547.  
  2548.  
  2549.         if choice1:
  2550.             st1brick.append(brickb)
  2551.             st1brick.append(brickb2)
  2552.             st1brick.append(brickb3)
  2553.             st1brick.append(brickb4)
  2554.         if choice2:
  2555.             st4brick.append(sbrickb)
  2556.             st4brick.append(sbrickb2)
  2557.             st4brick.append(sbrickb3)
  2558.             st4brick.append(sbrickb4)
  2559.             st4brick.append(sbrickb5)
  2560.             st4brick.append(sbrickb6)
  2561. #stage 4.5
  2562.  
  2563.  
  2564.     if stageiteration % 80 == 0 and level == 4 and stageiteration > 2000:
  2565.         x = 0
  2566.         if stageiteration in [2720, 2880, 3440, 3760]:
  2567.             x = -150
  2568.             choice3 = True
  2569.         if stageiteration in [2320, 2400, 2080, 2560, 3120, 3360, 3840]:
  2570.             x = 0
  2571.             choice1 = True
  2572.         if stageiteration in [2960, 3200, 3600, 3680]:
  2573.             x = 150
  2574.             choice3 = True
  2575.         if stageiteration in [2240, 2640, 3040, 3280]:
  2576.             choice1 = True
  2577.             x = 80
  2578.         if stageiteration in [2160, 2480, 2800, 3520, 3920, 4000]:
  2579.             choice2 = True
  2580.             x = -80
  2581.         hbrickbody.top = windowSurface.get_rect().top
  2582.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2583.         hbrickb = list(hbrickbody)
  2584.         hbrickb2 = list(hbrickbody)
  2585.         hbrickb2[0] = hbrickb2[0]+ 110
  2586.         hbrickb3 = list(hbrickbody)
  2587.         hbrickb3[0] = hbrickb3[0]- 110
  2588.         brickbody.top = windowSurface.get_rect().top
  2589.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2590.         brickb = list(brickbody)
  2591.         brickb2 = list(brickbody)
  2592.         brickb2[0] = brickb2[0]+ 110
  2593.         brickb3 = list(brickbody)
  2594.         brickb3[0] = brickb3[0]- 110
  2595.         sbrickbody.top = windowSurface.get_rect().top
  2596.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2597.         sbrickb = list(sbrickbody)
  2598.         sbrickb2 = list(sbrickbody)
  2599.         sbrickb2[0] = sbrickb2[0]+ 64
  2600.         sbrickb3 = list(sbrickbody)
  2601.         sbrickb3[0] = sbrickb3[0]- 64
  2602.         sbrickb4 = list(sbrickbody)
  2603.         sbrickb4[0] = sbrickb4[0]- 128
  2604.         sbrickb5 = list(sbrickbody)
  2605.         sbrickb5[0] = sbrickb5[0]+ 128
  2606.         ibrickbody.top = windowSurface.get_rect().top
  2607.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  2608.         ibrickb = list(ibrickbody)
  2609.         ibrickb2 = list(ibrickbody)
  2610.         ibrickb2[0] = ibrickb2[0]+ 110
  2611.         ibrickb3 = list(ibrickbody)
  2612.         ibrickb3[0] = ibrickb3[0]- 110
  2613.  
  2614.         if choice1:
  2615.             st3brick.append(hbrickb)
  2616.             st3brick.append(hbrickb2)
  2617.             st3brick.append(hbrickb3)
  2618.         if choice2:
  2619.             st4brick.append(sbrickb)
  2620.             st4brick.append(sbrickb2)
  2621.             st4brick.append(sbrickb3)
  2622.             st4brick.append(sbrickb4)
  2623.             st4brick.append(sbrickb5)
  2624.         if choice3:
  2625.             st2brick.append(ibrickb)
  2626.             st2brick.append(ibrickb2)
  2627.             st2brick.append(ibrickb3)
  2628.        
  2629.     if stageiteration == 4001 and level== 4:
  2630.         level = 5
  2631.         stageiteration = 0
  2632.         windowSurface.fill(black)
  2633.         textstage2 = basicfont.render('stage 5', True, (255, 255, 255), (0 , 0 , 0))
  2634.         tstage2rect= textstage2.get_rect()
  2635.         tstage2rect.centerx = windowSurface.get_rect().centerx
  2636.         tstage2rect.centery = windowSurface.get_rect().centery
  2637.         windowSurface.blit(textstage2, tstage2rect)
  2638.         pygame.display.update()
  2639.         sleep(3)
  2640.         lives = 20
  2641.         movedirx = 0
  2642.         energyint = 71
  2643.     #stage 4_end
  2644. #____________________stage 5_____________________:
  2645.     if stageiteration % 80 == 0 and level == 5 and stageiteration < 2001:
  2646.         if stageiteration in [720, 880, 1440, 1760, 400, 80, 560]:
  2647.             x = -150
  2648.             choice3 = True
  2649.         if stageiteration in [320, 1120, 1360, 1840]:
  2650.             x = 0
  2651.             choice1 = True
  2652.         if stageiteration in [960, 1200, 1600, 1680]:
  2653.             x = 150
  2654.             choice3 = True
  2655.         if stageiteration in [160, 480, 800, 1520, 1920, 2000]:
  2656.             choice1 = True
  2657.             x = 80
  2658.         if stageiteration in [240, 640, 1040, 1280]:
  2659.             choice2 = True
  2660.             x = -80      
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.         hbrickbody.top = windowSurface.get_rect().top
  2667.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2668.         hbrickb = list(hbrickbody)
  2669.         hbrickb2 = list(hbrickbody)
  2670.         hbrickb2[0] = hbrickb2[0]+ 110
  2671.         hbrickb3 = list(hbrickbody)
  2672.         hbrickb3[0] = hbrickb3[0]- 110
  2673.         brickbody.top = windowSurface.get_rect().top
  2674.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2675.         brickb = list(brickbody)
  2676.         brickb2 = list(brickbody)
  2677.         brickb2[0] = brickb2[0]+ 110
  2678.         brickb3 = list(brickbody)
  2679.         brickb3[0] = brickb3[0]- 110
  2680.         brickb4 = list(brickbody)
  2681.         brickb4[0] = brickb4[0]+ 220
  2682.         sbrickbody.top = windowSurface.get_rect().top
  2683.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2684.         sbrickb = list(sbrickbody)
  2685.         sbrickb2 = list(sbrickbody)
  2686.         sbrickb2[0] = sbrickb2[0]+ 64
  2687.         sbrickb3 = list(sbrickbody)
  2688.         sbrickb3[0] = sbrickb3[0]- 64
  2689.         sbrickb4 = list(sbrickbody)
  2690.         sbrickb4[0] = sbrickb4[0]- 128
  2691.         sbrickb5 = list(sbrickbody)
  2692.         sbrickb5[0] = sbrickb5[0]+ 128
  2693.         sbrickb6 = list(sbrickbody)
  2694.         sbrickb6[0] = sbrickb6[0]+ 192
  2695.         ibrickbody.top = windowSurface.get_rect().top
  2696.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  2697.         ibrickb = list(ibrickbody)
  2698.         ibrickb2 = list(ibrickbody)
  2699.         ibrickb2[0] = ibrickb2[0]+ 110
  2700.         ibrickb3 = list(ibrickbody)
  2701.         ibrickb3[0] = ibrickb3[0]- 110
  2702.  
  2703.  
  2704.         if choice1:
  2705.             st3brick.append(hbrickb)
  2706.             st3brick.append(hbrickb2)
  2707.             st3brick.append(hbrickb3)
  2708.         if choice2:
  2709.             st4brick.append(sbrickb)
  2710.             st4brick.append(sbrickb2)
  2711.             st4brick.append(sbrickb3)
  2712.             st4brick.append(sbrickb4)
  2713.             st4brick.append(sbrickb5)
  2714.             st4brick.append(sbrickb6)
  2715.         if choice3:
  2716.             st2brick.append(ibrickb)
  2717.             st2brick.append(ibrickb2)
  2718.             st2brick.append(ibrickb3)
  2719. #stage 5.5
  2720.  
  2721.  
  2722.     if stageiteration % 80 == 0 and level == 5 and stageiteration > 2000:
  2723.         x = 0
  2724.         if stageiteration in [2720, 2880, 3440, 3760]:
  2725.             x = -150
  2726.             choice3 = True
  2727.         if stageiteration in [2320, 2400, 2560, 3120, 3360, 3840]:
  2728.             x = 0
  2729.             choice1 = True
  2730.         if stageiteration in [2960, 3200, 3600, 3680]:
  2731.             x = 150
  2732.             choice3 = True
  2733.         if stageiteration in [2240, 2640, 3040, 3280]:
  2734.             choice1 = True
  2735.             x = 80
  2736.         if stageiteration in [2160, 2480, 2800, 3920, 4000]:
  2737.             choice2 = True
  2738.             x = -80
  2739.  
  2740.         if stageiteration in [2080, 3520]:
  2741.             choiceh = True
  2742.             hx = -20
  2743.  
  2744.            
  2745.         hbrickbody.top = windowSurface.get_rect().top
  2746.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2747.         hbrickb = list(hbrickbody)
  2748.         hbrickb2 = list(hbrickbody)
  2749.         hbrickb2[0] = hbrickb2[0]+ 110
  2750.         hbrickb3 = list(hbrickbody)
  2751.         hbrickb3[0] = hbrickb3[0]- 110
  2752.         brickbody.top = windowSurface.get_rect().top
  2753.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2754.         brickb = list(brickbody)
  2755.         brickb2 = list(brickbody)
  2756.         brickb2[0] = brickb2[0]+ 110
  2757.         brickb3 = list(brickbody)
  2758.         brickb3[0] = brickb3[0]- 110
  2759.         sbrickbody.top = windowSurface.get_rect().top
  2760.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2761.         sbrickb = list(sbrickbody)
  2762.         sbrickb2 = list(sbrickbody)
  2763.         sbrickb2[0] = sbrickb2[0]+ 64
  2764.         sbrickb3 = list(sbrickbody)
  2765.         sbrickb3[0] = sbrickb3[0]- 64
  2766.         sbrickb4 = list(sbrickbody)
  2767.         sbrickb4[0] = sbrickb4[0]- 128
  2768.         sbrickb5 = list(sbrickbody)
  2769.         sbrickb5[0] = sbrickb5[0]+ 128
  2770.         ibrickbody.top = windowSurface.get_rect().top
  2771.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  2772.         ibrickb = list(ibrickbody)
  2773.         ibrickb2 = list(ibrickbody)
  2774.         ibrickb2[0] = ibrickb2[0]+ 110
  2775.         ibrickb3 = list(ibrickbody)
  2776.         ibrickb3[0] = ibrickb3[0]- 110
  2777.         hpbody.top = windowSurface.get_rect().top - 300
  2778.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  2779.         hpb = list(hpbody)
  2780.         hpb2 = list(hpbody)
  2781.         hpb2[0] = hpb[0]+ 40
  2782.        
  2783.         if choice1:
  2784.             st3brick.append(hbrickb)
  2785.             st3brick.append(hbrickb2)
  2786.             st3brick.append(hbrickb3)
  2787.         if choice2:
  2788.             st4brick.append(sbrickb)
  2789.             st4brick.append(sbrickb2)
  2790.             st4brick.append(sbrickb3)
  2791.             st4brick.append(sbrickb4)
  2792.             st4brick.append(sbrickb5)
  2793.         if choice3:
  2794.             st2brick.append(ibrickb)
  2795.             st2brick.append(ibrickb2)
  2796.             st2brick.append(ibrickb3)
  2797.  
  2798.  
  2799.         if choiceh:
  2800.             st1hp.append(hpb)
  2801.             st1hp.append(hpb2)
  2802.             choiceh = 0
  2803.        
  2804.     if stageiteration == 4001 and level == 5:
  2805.         level = 6
  2806.         stageiteration = 0
  2807.         windowSurface.fill(black)
  2808.         textstage2 = basicfont.render('stage 6', True, (255, 255, 255), (0 , 0 , 0))
  2809.         tstage2rect= textstage2.get_rect()
  2810.         tstage2rect.centerx = windowSurface.get_rect().centerx
  2811.         tstage2rect.centery = windowSurface.get_rect().centery
  2812.         windowSurface.blit(textstage2, tstage2rect)
  2813.         pygame.display.update()
  2814.         sleep(3)
  2815.         lives = 20
  2816.         movedirx = 0
  2817.         energyint = 71
  2818.     #stage 5_end
  2819.  
  2820. #____________________stage 6_____________________:
  2821.     if stageiteration % 70 == 0 and level == 6 and stageiteration < 2001:
  2822.  
  2823.         if stageiteration in [420, 630, 1260, 1330]:
  2824.             x = -150
  2825.             choice1 = True
  2826.         if stageiteration in [70, 490, 910, 1190, 1400, 1470]:
  2827.             x = 0
  2828.             choice1 = True
  2829.         if stageiteration in [210, 840, 1120, 1890]:
  2830.             choice2 = True
  2831.             x = 150
  2832.         if stageiteration in [210, 770, 1050, 1680, 1750]:
  2833.             x = 0
  2834.             choice2 = True
  2835.         if stageiteration in [140, 280, 560, 1540]:
  2836.             x = -150
  2837.             choice3 = True
  2838.         if stageiteration in [350, 770, 1610]:
  2839.             choice3 = True
  2840.             x = 80
  2841.         if stageiteration in [1960]:
  2842.             x = 150
  2843.             choice4 = True
  2844.         if stageiteration in []:
  2845.             choice4 = True
  2846.             x = 80
  2847.         if stageiteration in []:
  2848.             x = 80
  2849.             choice5 = True
  2850.         if stageiteration in [700, 980, 1820]:
  2851.             choice1 = True
  2852.             x = -80      
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.         hbrickbody.top = windowSurface.get_rect().top
  2859.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2860.         hbrickb = list(hbrickbody)
  2861.         hbrickb2 = list(hbrickbody)
  2862.         hbrickb2[0] = hbrickb2[0]+ 110
  2863.         hbrickb3 = list(hbrickbody)
  2864.         hbrickb3[0] = hbrickb3[0]- 110
  2865.         brickbody.top = windowSurface.get_rect().top
  2866.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2867.         brickb = list(brickbody)
  2868.         brickb2 = list(brickbody)
  2869.         brickb2[0] = brickb2[0]+ 110
  2870.         brickb3 = list(brickbody)
  2871.         brickb3[0] = brickb3[0]- 110
  2872.         brickb4 = list(brickbody)
  2873.         brickb4[0] = brickb4[0]+ 220
  2874.         sbrickbody.top = windowSurface.get_rect().top
  2875.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2876.         sbrickb = list(sbrickbody)
  2877.         sbrickb2 = list(sbrickbody)
  2878.         sbrickb2[0] = sbrickb2[0]+ 64
  2879.         sbrickb3 = list(sbrickbody)
  2880.         sbrickb3[0] = sbrickb3[0]- 64
  2881.         sbrickb4 = list(sbrickbody)
  2882.         sbrickb4[0] = sbrickb4[0]- 128
  2883.         sbrickb5 = list(sbrickbody)
  2884.         sbrickb5[0] = sbrickb5[0]+ 128
  2885.         sbrickb6 = list(sbrickbody)
  2886.         sbrickb6[0] = sbrickb6[0]+ 192
  2887.         ibrickbody.top = windowSurface.get_rect().top
  2888.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  2889.         ibrickb = list(ibrickbody)
  2890.         ibrickb2 = list(ibrickbody)
  2891.         ibrickb2[0] = ibrickb2[0]+ 110
  2892.         ibrickb3 = list(ibrickbody)
  2893.         ibrickb3[0] = ibrickb3[0]- 110
  2894.  
  2895.  
  2896.         if choice1:
  2897.             st1brick.append(brickb)
  2898.             st1brick.append(brickb2)
  2899.             st1brick.append(brickb3)
  2900.             st1brick.append(brickb4)
  2901.  
  2902.         if choice2:
  2903.             st3brick.append(hbrickb)
  2904.             st3brick.append(hbrickb2)
  2905.             st3brick.append(hbrickb3)
  2906.  
  2907.            
  2908.  
  2909.         if choice3:
  2910.             st4brick.append(sbrickb)
  2911.             st4brick.append(sbrickb2)
  2912.             st4brick.append(sbrickb3)
  2913.             st4brick.append(sbrickb4)
  2914.             st4brick.append(sbrickb5)
  2915.             st4brick.append(sbrickb6)
  2916. #stage 6.5
  2917.  
  2918.  
  2919.     if stageiteration % 70 == 0 and level == 6 and stageiteration > 2000:
  2920.         x = 0
  2921.        
  2922.         if stageiteration in [2870, 3150, 3430]:
  2923.             x = -150
  2924.             choice1 = True
  2925.         if stageiteration in [2170, 3360, 3920, 3990]:
  2926.             x = 0
  2927.             choice1 = True
  2928.         if stageiteration in [1240, 3290, 3500]:
  2929.             choice2 = True
  2930.             x = 150
  2931.         if stageiteration in [2660, 2730, 2800]:
  2932.             x = 0
  2933.             choice2 = True
  2934.         if stageiteration in [2450, 3080]:
  2935.             x = -150
  2936.             choice3 = True
  2937.         if stageiteration in [2380, 3010, 3640, 3780]:
  2938.             choice3 = True
  2939.             x = 80
  2940.         if stageiteration in [2520, 2940, 3850]:
  2941.             x = 150
  2942.             choice4 = True
  2943.         if stageiteration in [2590, 3570, 3710]:
  2944.             choice4 = True
  2945.             x = 80
  2946.         if stageiteration in [3220]:
  2947.             choiceh = True
  2948.             hx = -80
  2949.         if stageiteration in [2310]:
  2950.             choice1 = True
  2951.             x = -80  
  2952.  
  2953.         if stageiteration in [2100]:
  2954.             choiceh = True
  2955.             hx = -20
  2956.         if stageiteration in [2030]:
  2957.             choicee = True
  2958.             ex = -30
  2959.  
  2960.            
  2961.         hbrickbody.top = windowSurface.get_rect().top
  2962.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  2963.         hbrickb = list(hbrickbody)
  2964.         hbrickb2 = list(hbrickbody)
  2965.         hbrickb2[0] = hbrickb2[0]+ 110
  2966.         hbrickb3 = list(hbrickbody)
  2967.         hbrickb3[0] = hbrickb3[0]- 110
  2968.         brickbody.top = windowSurface.get_rect().top
  2969.         brickbody.centerx = windowSurface.get_rect().centerx + x
  2970.         brickb = list(brickbody)
  2971.         brickb2 = list(brickbody)
  2972.         brickb2[0] = brickb2[0]+ 110
  2973.         brickb3 = list(brickbody)
  2974.         brickb3[0] = brickb3[0]- 110
  2975.         brickb4 = list(brickbody)
  2976.         brickb4[0] = brickb3[0]- 220
  2977.         sbrickbody.top = windowSurface.get_rect().top
  2978.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  2979.         sbrickb = list(sbrickbody)
  2980.         sbrickb2 = list(sbrickbody)
  2981.         sbrickb2[0] = sbrickb2[0]+ 64
  2982.         sbrickb3 = list(sbrickbody)
  2983.         sbrickb3[0] = sbrickb3[0]- 64
  2984.         sbrickb4 = list(sbrickbody)
  2985.         sbrickb4[0] = sbrickb4[0]- 128
  2986.         sbrickb5 = list(sbrickbody)
  2987.         sbrickb5[0] = sbrickb5[0]+ 128
  2988.         ibrickbody.top = windowSurface.get_rect().top
  2989.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  2990.         ibrickb = list(ibrickbody)
  2991.         ibrickb2 = list(ibrickbody)
  2992.         ibrickb2[0] = ibrickb2[0]+ 110
  2993.         ibrickb3 = list(ibrickbody)
  2994.         ibrickb3[0] = ibrickb3[0]- 110
  2995.         hpbody.top = windowSurface.get_rect().top - 300
  2996.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  2997.         hpb = list(hpbody)
  2998.         hpb2 = list(hpbody)
  2999.         hpb2[0] = hpb[0]+ 40
  3000.         epbody.top = windowSurface.get_rect().top - 100
  3001.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3002.         epb = list(epbody)
  3003.         epb2 = list(epbody)
  3004.         epb2[0] = epb[0]+ 60
  3005.         sbrickb6 = list(sbrickbody)
  3006.         sbrickb6[0] = sbrickb5[0]- 192
  3007.  
  3008.  
  3009.         if choice1:
  3010.             st1brick.append(brickb)
  3011.             st1brick.append(brickb2)
  3012.             st1brick.append(brickb3)
  3013.             st1brick.append(brickb4)
  3014.  
  3015.         if choice2:
  3016.             st3brick.append(hbrickb)
  3017.             st3brick.append(hbrickb2)
  3018.             st3brick.append(hbrickb3)
  3019.  
  3020.            
  3021.  
  3022.         if choice3:
  3023.             st4brick.append(sbrickb)
  3024.             st4brick.append(sbrickb2)
  3025.             st4brick.append(sbrickb3)
  3026.             st4brick.append(sbrickb4)
  3027.             st4brick.append(sbrickb6)
  3028.             st4brick.append(sbrickb5)
  3029.  
  3030.            
  3031.         if choice4:
  3032.             st2brick.append(ibrickb)
  3033.             st2brick.append(ibrickb2)
  3034.             st2brick.append(ibrickb3)
  3035.  
  3036.  
  3037.         if choiceh:
  3038.             st1hp.append(hpb)
  3039.             st1hp.append(hpb2)
  3040.  
  3041.  
  3042.         if choicee:
  3043.             st1ep.append(epb)
  3044.             st1ep.append(epb2)
  3045.  
  3046.      
  3047.     if stageiteration == 4200 and level == 6:
  3048.         level = 7
  3049.         stageiteration = 0
  3050.         windowSurface.fill(black)
  3051.         textstage2 = basicfont.render('stage 7', True, (255, 255, 255), (0 , 0 , 0))
  3052.         tstage2rect= textstage2.get_rect()
  3053.         tstage2rect.centerx = windowSurface.get_rect().centerx
  3054.         tstage2rect.centery = windowSurface.get_rect().centery
  3055.         windowSurface.blit(textstage2, tstage2rect)
  3056.         pygame.display.update()
  3057.         sleep(3)
  3058.         lives = 20
  3059.         movedirx = 0
  3060.         energyint = 71
  3061.     #stage 6_end
  3062. #_______________________________stage 7_____________________________________:
  3063.  
  3064.  
  3065.  
  3066.     if stageiteration % 70 == 0 and level == 7 and stageiteration < 2001:
  3067.         x = 0
  3068.        
  3069.         if stageiteration in [420, 700, 1190, 210]:
  3070.             x = -150
  3071.             choice1 = True
  3072.         if stageiteration in [70, 1050, 1120, 1680, 1960]:
  3073.             x = 0
  3074.             choice1 = True
  3075.         if stageiteration in [140, 770, 1470]:
  3076.             choice2 = True
  3077.             x = 150
  3078.         if stageiteration in [350, 840, 980]:
  3079.             x = 0
  3080.             choice2 = True
  3081.         if stageiteration in [280, 1260, 1610, 1820]:
  3082.             x = -150
  3083.             choice3 = True
  3084.         if stageiteration in [630, 910, 1330, 1750]:
  3085.             choice3 = True
  3086.             x = 80
  3087.         if stageiteration in [560, 1400]:
  3088.             x = 150
  3089.             choice4 = True
  3090.         if stageiteration in [490, 1540, 1890]:
  3091.             choice4 = True
  3092.             x = -80
  3093.         if stageiteration in []:
  3094.             choiceh = True
  3095.             hx = -80
  3096.         if stageiteration in []:
  3097.             choice1 = True
  3098.             x = -80  
  3099.  
  3100.         if stageiteration in []:
  3101.             choiceh = True
  3102.             hx = -20
  3103.         if stageiteration in []:
  3104.             choicee = True
  3105.             ex = -30
  3106.  
  3107.            
  3108.         hbrickbody.top = windowSurface.get_rect().top
  3109.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3110.         hbrickb = list(hbrickbody)
  3111.         hbrickb2 = list(hbrickbody)
  3112.         hbrickb2[0] = hbrickb2[0]+ 110
  3113.         hbrickb3 = list(hbrickbody)
  3114.         hbrickb3[0] = hbrickb3[0]- 110
  3115.         brickbody.top = windowSurface.get_rect().top
  3116.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3117.         brickb = list(brickbody)
  3118.         brickb2 = list(brickbody)
  3119.         brickb2[0] = brickb2[0]+ 110
  3120.         brickb3 = list(brickbody)
  3121.         brickb3[0] = brickb3[0]- 110
  3122.         brickb4 = list(brickbody)
  3123.         brickb4[0] = brickb4[0]+ 220
  3124.         sbrickbody.top = windowSurface.get_rect().top
  3125.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  3126.         sbrickb = list(sbrickbody)
  3127.         sbrickb2 = list(sbrickbody)
  3128.         sbrickb2[0] = sbrickb2[0]+ 64
  3129.         sbrickb3 = list(sbrickbody)
  3130.         sbrickb3[0] = sbrickb3[0]- 64
  3131.         sbrickb4 = list(sbrickbody)
  3132.         sbrickb4[0] = sbrickb4[0]- 128
  3133.         sbrickb5 = list(sbrickbody)
  3134.         sbrickb5[0] = sbrickb5[0]+ 128
  3135.         sbrickb6 = list(sbrickbody)
  3136.         sbrickb6[0] = sbrickb6[0]+ 192
  3137.         ibrickbody.top = windowSurface.get_rect().top
  3138.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  3139.         ibrickb = list(ibrickbody)
  3140.         ibrickb2 = list(ibrickbody)
  3141.         ibrickb2[0] = ibrickb2[0]+ 110
  3142.         ibrickb3 = list(ibrickbody)
  3143.         ibrickb3[0] = ibrickb3[0]- 110
  3144.  
  3145.         hpbody.top = windowSurface.get_rect().top - 300
  3146.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  3147.         hpb = list(hpbody)
  3148.         hpb2 = list(hpbody)
  3149.         hpb2[0] = hpb[0]+ 40
  3150.         epbody.top = windowSurface.get_rect().top - 100
  3151.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3152.         epb = list(epbody)
  3153.         epb2 = list(epbody)
  3154.         epb2[0] = epb[0]+ 60
  3155.        
  3156.  
  3157.  
  3158.         if choice1:
  3159.             st1brick.append(brickb)
  3160.             st1brick.append(brickb2)
  3161.             st1brick.append(brickb3)
  3162.             st1brick.append(brickb4)
  3163.  
  3164.         if choice2 == True:
  3165.             st3brick.append(hbrickb)
  3166.             st3brick.append(hbrickb2)
  3167.             st3brick.append(hbrickb3)
  3168.  
  3169.            
  3170.  
  3171.         if choice3:
  3172.             st4brick.append(sbrickb)
  3173.             st4brick.append(sbrickb2)
  3174.             st4brick.append(sbrickb3)
  3175.             st4brick.append(sbrickb4)
  3176.             st4brick.append(sbrickb5)
  3177.             st4brick.append(sbrickb6)
  3178.            
  3179.         if choice4:
  3180.             st2brick.append(ibrickb)
  3181.             st2brick.append(ibrickb2)
  3182.             st2brick.append(ibrickb3)
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.     if stageiteration % 70 == 0 and level == 7 and stageiteration > 2025:
  3189.         x = 0
  3190.        
  3191.         if stageiteration in [2030, 3290, 3710]:
  3192.             x = -90
  3193.             choice4 = True
  3194.         if stageiteration in [2520, 3640]:
  3195.             x = -10
  3196.             choice1 = True
  3197.         if stageiteration in [2100, 3010, 3570]:
  3198.             choice2 = True
  3199.             x = 140
  3200.         if stageiteration in [2450, 2940, 3500]:
  3201.             x = 5
  3202.             choice3 = True
  3203.         if stageiteration in [2100, 2730, 3430, 3780]:
  3204.             x = -130
  3205.             choice3 = True
  3206.         if stageiteration in [2170, 2870, 3360, 3990]:
  3207.             choice3 = True
  3208.             x = 90
  3209.         if stageiteration in [2240, 2800, 3220, 3920]:
  3210.             x = 120
  3211.             choice4 = True
  3212.         if stageiteration in [2310, 2590, 3150, 3850]:
  3213.             choice4 = True
  3214.             x = 0
  3215.         if stageiteration in []:
  3216.             choiceh = True
  3217.             hx = -80
  3218.         if stageiteration in []:
  3219.             choice1 = True
  3220.             x = -80  
  3221.  
  3222.         if stageiteration in [2660, 3080]:
  3223.             choiceh = True
  3224.  
  3225.             hx = -40
  3226.         if stageiteration in [2380]:
  3227.             choicee = True
  3228.  
  3229.             ex = -30
  3230.  
  3231.            
  3232.         hbrickbody.top = windowSurface.get_rect().top
  3233.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3234.         hbrickb = list(hbrickbody)
  3235.         hbrickb2 = list(hbrickbody)
  3236.         hbrickb2[0] = hbrickb2[0]+ 110
  3237.         hbrickb3 = list(hbrickbody)
  3238.         hbrickb3[0] = hbrickb3[0]- 110
  3239.         brickbody.top = windowSurface.get_rect().top
  3240.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3241.         brickb = list(brickbody)
  3242.         brickb2 = list(brickbody)
  3243.         brickb2[0] = brickb2[0]+ 110
  3244.         brickb3 = list(brickbody)
  3245.         brickb3[0] = brickb3[0]- 110
  3246.         brickb4 = list(brickbody)
  3247.         brickb4[0] = brickb4[0]+ 220
  3248.         sbrickbody.top = windowSurface.get_rect().top
  3249.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  3250.         sbrickb = list(sbrickbody)
  3251.         sbrickb2 = list(sbrickbody)
  3252.         sbrickb2[0] = sbrickb2[0]+ 64
  3253.         sbrickb3 = list(sbrickbody)
  3254.         sbrickb3[0] = sbrickb3[0]- 64
  3255.         sbrickb4 = list(sbrickbody)
  3256.         sbrickb4[0] = sbrickb4[0]- 128
  3257.         sbrickb5 = list(sbrickbody)
  3258.         sbrickb5[0] = sbrickb5[0]+ 128
  3259.         sbrickb6 = list(sbrickbody)
  3260.         sbrickb6[0] = sbrickb6[0]+ 192
  3261.         ibrickbody.top = windowSurface.get_rect().top
  3262.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  3263.         ibrickb = list(ibrickbody)
  3264.         ibrickb2 = list(ibrickbody)
  3265.         ibrickb2[0] = ibrickb2[0]+ 110
  3266.         ibrickb3 = list(ibrickbody)
  3267.         ibrickb3[0] = ibrickb3[0]- 110
  3268.         rbrickb = list(rbrickbody)
  3269.         rbrickb2 = list(rbrickbody)
  3270.         rbrickb2[0] = rbrickb2[0]+ 110
  3271.         rbrickb3 = list(rbrickbody)
  3272.         rbrickb3[0] = rbrickb3[0]- 110
  3273.         hpbody.top = windowSurface.get_rect().top - 300
  3274.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  3275.         hpb = list(hpbody)
  3276.         hpb2 = list(hpbody)
  3277.         hpb2[0] = hpb[0]+ 80
  3278.         epbody.top = windowSurface.get_rect().top - 100
  3279.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3280.         epb = list(epbody)
  3281.         epb2 = list(epbody)
  3282.         epb2[0] = epb[0]+ 60
  3283.        
  3284.  
  3285.  
  3286.         if choice1:
  3287.             st1brick.append(brickb)
  3288.             st1brick.append(brickb2)
  3289.             st1brick.append(brickb3)
  3290.             st1brick.append(brickb4)
  3291.  
  3292.         if choice2:
  3293.             st3brick.append(hbrickb)
  3294.             st3brick.append(hbrickb2)
  3295.             st3brick.append(hbrickb3)
  3296.  
  3297.            
  3298.  
  3299.         if choice3:
  3300.             st4brick.append(sbrickb)
  3301.             st4brick.append(sbrickb2)
  3302.             st4brick.append(sbrickb3)
  3303.             st4brick.append(sbrickb4)
  3304.             st4brick.append(sbrickb5)
  3305.             st4brick.append(sbrickb6)
  3306.            
  3307.         if choice4:
  3308.             st2brick.append(ibrickb)
  3309.             st2brick.append(ibrickb2)
  3310.             st2brick.append(ibrickb3)
  3311.  
  3312.         if choice5:
  3313.             st5brick.append(rbrickb)
  3314.             st5brick.append(rbrickb2)
  3315.             st5brick.append(rbrickb3)
  3316.            
  3317.         if choiceh:
  3318.             st1hp.append(hpb)
  3319.             st1hp.append(hpb2)
  3320.  
  3321.  
  3322.         if choicee:
  3323.             st1ep.append(epb)
  3324.             st1ep.append(epb2)
  3325.  
  3326.     if stageiteration == 4200 and level == 7:
  3327.         level = 8
  3328.         stageiteration = 0
  3329.         windowSurface.fill(black)
  3330.         textstage2 = basicfont.render('stage 8', True, (255, 255, 255), (0 , 0 , 0))
  3331.         tstage2rect= textstage2.get_rect()
  3332.         tstage2rect.centerx = windowSurface.get_rect().centerx
  3333.         tstage2rect.centery = windowSurface.get_rect().centery
  3334.         windowSurface.blit(textstage2, tstage2rect)
  3335.         pygame.display.update()
  3336.         sleep(3)
  3337.         lives = 20
  3338.         movedirx = 0
  3339.         energyint = 71
  3340. #________________________________________stage 7__End_____________________________:
  3341. #_______________________________stage 8_____________________________________:
  3342.  
  3343.  
  3344.  
  3345.     if stageiteration % 70 == 0 and level == 8 and stageiteration < 2001:
  3346.         x = 0
  3347.         if stageiteration in [350, 840, 980]:
  3348.             x = -90
  3349.             choice4 = True
  3350.         if stageiteration in [140, 770, 1470]:
  3351.             x = -10
  3352.             choice1 = True
  3353.         if stageiteration in [70, 1050, 1120, 1680, 1960]:
  3354.             choice2 = True
  3355.             x = 140
  3356.         if stageiteration in [420, 700, 1190, 210]:
  3357.             x = 5
  3358.             choice3 = True
  3359.         if stageiteration in [490, 1540, 1890]:
  3360.             x = -130
  3361.             choice3 = True
  3362.         if stageiteration in [280, 1260, 1610, 1820]:
  3363.             choice3 = True
  3364.             x = 90
  3365.         if stageiteration in [630, 910, 1330, 1750]:
  3366.             x = 120
  3367.             choice4 = True
  3368.         if stageiteration in [560, 1400]:
  3369.             choice4 = True
  3370.             x = 0
  3371.         if stageiteration in []:
  3372.             choiceh = True
  3373.             hx = -80
  3374.         if stageiteration in []:
  3375.             choice1 = True
  3376.             x = -80  
  3377.  
  3378.         if stageiteration in [2660, 3080]:
  3379.             choiceh = True
  3380.  
  3381.             hx = -40
  3382.         if stageiteration in [2380]:
  3383.             choicee = True
  3384.  
  3385.             ex = -30
  3386.  
  3387.            
  3388.         hbrickbody.top = windowSurface.get_rect().top
  3389.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3390.         hbrickb = list(hbrickbody)
  3391.         hbrickb2 = list(hbrickbody)
  3392.         hbrickb2[0] = hbrickb2[0]+ 110
  3393.         hbrickb3 = list(hbrickbody)
  3394.         hbrickb3[0] = hbrickb3[0]- 110
  3395.         brickbody.top = windowSurface.get_rect().top
  3396.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3397.         brickb = list(brickbody)
  3398.         brickb2 = list(brickbody)
  3399.         brickb2[0] = brickb2[0]+ 110
  3400.         brickb3 = list(brickbody)
  3401.         brickb3[0] = brickb3[0]- 110
  3402.         brickb4 = list(brickbody)
  3403.         brickb4[0] = brickb4[0]+ 220
  3404.         sbrickbody.top = windowSurface.get_rect().top
  3405.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  3406.         sbrickb = list(sbrickbody)
  3407.         sbrickb2 = list(sbrickbody)
  3408.         sbrickb2[0] = sbrickb2[0]+ 64
  3409.         sbrickb3 = list(sbrickbody)
  3410.         sbrickb3[0] = sbrickb3[0]- 64
  3411.         sbrickb4 = list(sbrickbody)
  3412.         sbrickb4[0] = sbrickb4[0]- 128
  3413.         sbrickb5 = list(sbrickbody)
  3414.         sbrickb5[0] = sbrickb5[0]+ 128
  3415.         sbrickb6 = list(sbrickbody)
  3416.         sbrickb6[0] = sbrickb6[0]+ 192
  3417.         ibrickbody.top = windowSurface.get_rect().top
  3418.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  3419.         ibrickb = list(ibrickbody)
  3420.         ibrickb2 = list(ibrickbody)
  3421.         ibrickb2[0] = ibrickb2[0]+ 110
  3422.         ibrickb3 = list(ibrickbody)
  3423.         ibrickb3[0] = ibrickb3[0]- 110
  3424.         rbrickb = list(rbrickbody)
  3425.         rbrickb2 = list(rbrickbody)
  3426.         rbrickb2[0] = rbrickb2[0]+ 110
  3427.         rbrickb3 = list(rbrickbody)
  3428.         rbrickb3[0] = rbrickb3[0]- 110
  3429.         hpbody.top = windowSurface.get_rect().top - 300
  3430.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  3431.         hpb = list(hpbody)
  3432.         hpb2 = list(hpbody)
  3433.         hpb2[0] = hpb[0]+ 80
  3434.         epbody.top = windowSurface.get_rect().top - 100
  3435.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3436.         epb = list(epbody)
  3437.         epb2 = list(epbody)
  3438.         epb2[0] = epb[0]+ 60
  3439.        
  3440.  
  3441.  
  3442.         if choice1:
  3443.             st1brick.append(brickb)
  3444.             st1brick.append(brickb2)
  3445.             st1brick.append(brickb3)
  3446.             st1brick.append(brickb4)
  3447.  
  3448.         if choice2:
  3449.             st3brick.append(hbrickb)
  3450.             st3brick.append(hbrickb2)
  3451.             st3brick.append(hbrickb3)
  3452.  
  3453.            
  3454.  
  3455.         if choice3:
  3456.             st4brick.append(sbrickb)
  3457.             st4brick.append(sbrickb2)
  3458.             st4brick.append(sbrickb3)
  3459.             st4brick.append(sbrickb4)
  3460.             st4brick.append(sbrickb5)
  3461.             st4brick.append(sbrickb6)
  3462.            
  3463.         if choice4:
  3464.             st2brick.append(ibrickb)
  3465.             st2brick.append(ibrickb2)
  3466.             st2brick.append(ibrickb3)
  3467.  
  3468.         if choice5:
  3469.             st5brick.append(rbrickb)
  3470.             st5brick.append(rbrickb2)
  3471.             st5brick.append(rbrickb3)
  3472.            
  3473.         if choiceh:
  3474.             st1hp.append(hpb)
  3475.             st1hp.append(hpb2)
  3476.  
  3477.  
  3478.         if choicee:
  3479.             st1ep.append(epb)
  3480.             st1ep.append(epb2)
  3481.  
  3482.    
  3483.  
  3484.  
  3485.     if stageiteration % 70 == 0 and level == 8 and stageiteration > 2025:
  3486.         x = 0
  3487.         if stageiteration in [2030, 2170, 3010, 3780, 3290, 3710]:
  3488.             x = 0
  3489.             choice5 = True
  3490.         if stageiteration in [2590, 3080, 3500]:
  3491.             x = 150
  3492.             choice2 = True
  3493.         if stageiteration in [2380, 2730]:
  3494.             choice2 = True
  3495.             x = 80
  3496.         if stageiteration in [2660, 2800, 3640]:
  3497.             x = 30
  3498.             choice5 = True
  3499.         if stageiteration in [2100, 3220, 3990]:
  3500.             x = -150
  3501.             choice4 = True
  3502.         if stageiteration in [2310, 2870, 3360, 3850]:
  3503.             choice3 = True
  3504.             x = -80
  3505.         if stageiteration in [2450, 2940, 3430, 3570]:
  3506.             x = 30
  3507.             choice3 = True
  3508.         if stageiteration in [2520, 3150, 3920]:
  3509.             choice4 = True
  3510.             x = -30
  3511.         if stageiteration in [2240]:
  3512.             choiceh = True
  3513.             hx = -80
  3514.         if stageiteration in [2590, 3080, 3500]:
  3515.             choice5 = True
  3516.             x = -5  
  3517.  
  3518.         if stageiteration in [3500]:
  3519.             choiceh = 1
  3520.             choicee = 0
  3521.             choice = 0
  3522.             hx = -20
  3523.         if stageiteration in [2030]:
  3524.             choicee = 1
  3525.             choiceh = 0
  3526.             choice = 0
  3527.             ex = -30
  3528.  
  3529.            
  3530.         hbrickbody.top = windowSurface.get_rect().top
  3531.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3532.         hbrickb = list(hbrickbody)
  3533.         hbrickb2 = list(hbrickbody)
  3534.         hbrickb2[0] = hbrickb2[0]+ 110
  3535.         hbrickb3 = list(hbrickbody)
  3536.         hbrickb3[0] = hbrickb3[0]- 110
  3537.         brickbody.top = windowSurface.get_rect().top
  3538.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3539.         brickb = list(brickbody)
  3540.         brickb2 = list(brickbody)
  3541.         brickb2[0] = brickb2[0]+ 110
  3542.         brickb3 = list(brickbody)
  3543.         brickb3[0] = brickb3[0]- 110
  3544.         brickb4 = list(brickbody)
  3545.         brickb4[0] = brickb4[0]+ 220
  3546.         sbrickbody.top = windowSurface.get_rect().top
  3547.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  3548.         sbrickb = list(sbrickbody)
  3549.         sbrickb2 = list(sbrickbody)
  3550.         sbrickb2[0] = sbrickb2[0]+ 64
  3551.         sbrickb3 = list(sbrickbody)
  3552.         sbrickb3[0] = sbrickb3[0]- 64
  3553.         sbrickb4 = list(sbrickbody)
  3554.         sbrickb4[0] = sbrickb4[0]- 128
  3555.         sbrickb5 = list(sbrickbody)
  3556.         sbrickb5[0] = sbrickb5[0]+ 128
  3557.         sbrickb6 = list(sbrickbody)
  3558.         sbrickb6[0] = sbrickb6[0]+ 192
  3559.         ibrickbody.top = windowSurface.get_rect().top
  3560.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  3561.         ibrickb = list(ibrickbody)
  3562.         ibrickb2 = list(ibrickbody)
  3563.         ibrickb2[0] = ibrickb2[0]+ 110
  3564.         ibrickb3 = list(ibrickbody)
  3565.         ibrickb3[0] = ibrickb3[0]- 110
  3566.         rbrickb = list(rbrickbody)
  3567.         rbrickb2 = list(rbrickbody)
  3568.         rbrickb2[0] = rbrickb2[0]+ 110
  3569.         rbrickb3 = list(rbrickbody)
  3570.         rbrickb3[0] = rbrickb3[0]- 110
  3571.         hpbody.top = windowSurface.get_rect().top - 300
  3572.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  3573.         hpb = list(hpbody)
  3574.         hpb2 = list(hpbody)
  3575.         hpb2[0] = hpb[0]+ 80
  3576.         epbody.top = windowSurface.get_rect().top - 100
  3577.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3578.         epb = list(epbody)
  3579.         epb2 = list(epbody)
  3580.         epb2[0] = epb[0]+ 60
  3581.        
  3582.  
  3583.  
  3584.         if choice1:
  3585.             st1brick.append(brickb)
  3586.             st1brick.append(brickb2)
  3587.             st1brick.append(brickb3)
  3588.             st1brick.append(brickb4)
  3589.  
  3590.         if choice2:
  3591.             st3brick.append(hbrickb)
  3592.             st3brick.append(hbrickb2)
  3593.             st3brick.append(hbrickb3)
  3594.  
  3595.            
  3596.  
  3597.         if choice3:
  3598.             st4brick.append(sbrickb)
  3599.             st4brick.append(sbrickb2)
  3600.             st4brick.append(sbrickb3)
  3601.             st4brick.append(sbrickb4)
  3602.             st4brick.append(sbrickb5)
  3603.             st4brick.append(sbrickb6)
  3604.            
  3605.         if choice4:
  3606.             st2brick.append(ibrickb)
  3607.             st2brick.append(ibrickb2)
  3608.             st2brick.append(ibrickb3)
  3609.  
  3610.         if choice5:
  3611.             st5brick.append(rbrickb)
  3612.             st5brick.append(rbrickb2)
  3613.             st5brick.append(rbrickb3)
  3614.            
  3615.         if choiceh:
  3616.             st1hp.append(hpb)
  3617.             st1hp.append(hpb2)
  3618.  
  3619.  
  3620.         if choicee:
  3621.             st1ep.append(epb)
  3622.             st1ep.append(epb2)
  3623.     if stageiteration == 4200 and level == 8:
  3624.         level = 9
  3625.         stageiteration = 0
  3626.         windowSurface.fill(black)
  3627.         textstage2 = basicfont.render('stage 9', True, (255, 255, 255), (0 , 0 , 0))
  3628.         tstage2rect= textstage2.get_rect()
  3629.         tstage2rect.centerx = windowSurface.get_rect().centerx
  3630.         tstage2rect.centery = windowSurface.get_rect().centery
  3631.         windowSurface.blit(textstage2, tstage2rect)
  3632.         pygame.display.update()
  3633.         sleep(3)
  3634.         lives = 20
  3635.         movedirx = 0
  3636.         energyint = 71
  3637.              
  3638. #________________________________________stage 8__End_____________________________:
  3639. #_______________________________stage 9_____________________________________:
  3640.  
  3641.  
  3642.  
  3643.     if stageiteration % 70 == 0 and level == 9 and stageiteration < 2001:
  3644.         x = 0
  3645.         if stageiteration in [70, 1050, 1120, 1680, 1960]:
  3646.             x = -90
  3647.             choice4 = True
  3648.         if stageiteration in [140, 770, 1470]:
  3649.             x = -10
  3650.             choice1 = True
  3651.         if stageiteration in [630, 910, 1330, 1750]:
  3652.             choice2 = True
  3653.             x = 140
  3654.         if stageiteration in [420, 700, 1190, 210]:
  3655.             x = 5
  3656.             choice3 = True
  3657.         if stageiteration in [490, 1540, 1890]:
  3658.             x = -130
  3659.             choice3 = True
  3660.         if stageiteration in [280, 1260, 1610, 1820]:
  3661.             choice3 = True
  3662.             x = 90
  3663.         if stageiteration in [350, 840, 980]:
  3664.             x = 120
  3665.             choice4 = True
  3666.         if stageiteration in [560, 1400]:
  3667.             choice4 = True
  3668.             x = 0
  3669.         if stageiteration in []:
  3670.             choiceh = True
  3671.             hx = -80
  3672.         if stageiteration in []:
  3673.             choice1 = True
  3674.             x = -80  
  3675.  
  3676.         if stageiteration in []:
  3677.             choiceh = True
  3678.  
  3679.             hx = -40
  3680.         if stageiteration in []:
  3681.             choicee = True
  3682.  
  3683.             ex = -30
  3684.  
  3685.            
  3686.         hbrickbody.top = windowSurface.get_rect().top
  3687.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3688.         hbrickb = list(hbrickbody)
  3689.         hbrickb2 = list(hbrickbody)
  3690.         hbrickb2[0] = hbrickb2[0]+ 110
  3691.         hbrickb3 = list(hbrickbody)
  3692.         hbrickb3[0] = hbrickb3[0]- 110
  3693.         brickbody.top = windowSurface.get_rect().top
  3694.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3695.         brickb = list(brickbody)
  3696.         brickb2 = list(brickbody)
  3697.         brickb2[0] = brickb2[0]+ 110
  3698.         brickb3 = list(brickbody)
  3699.         brickb3[0] = brickb3[0]- 110
  3700.         brickb4 = list(brickbody)
  3701.         brickb4[0] = brickb4[0]+ 220
  3702.         sbrickbody.top = windowSurface.get_rect().top
  3703.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  3704.         sbrickb = list(sbrickbody)
  3705.         sbrickb2 = list(sbrickbody)
  3706.         sbrickb2[0] = sbrickb2[0]+ 64
  3707.         sbrickb3 = list(sbrickbody)
  3708.         sbrickb3[0] = sbrickb3[0]- 64
  3709.         sbrickb4 = list(sbrickbody)
  3710.         sbrickb4[0] = sbrickb4[0]- 128
  3711.         sbrickb5 = list(sbrickbody)
  3712.         sbrickb5[0] = sbrickb5[0]+ 128
  3713.  
  3714.         ibrickbody.top = windowSurface.get_rect().top
  3715.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  3716.         ibrickb = list(ibrickbody)
  3717.         ibrickb2 = list(ibrickbody)
  3718.         ibrickb2[0] = ibrickb2[0]+ 110
  3719.         ibrickb3 = list(ibrickbody)
  3720.         ibrickb3[0] = ibrickb3[0]- 110
  3721.         rbrickb = list(rbrickbody)
  3722.         rbrickb2 = list(rbrickbody)
  3723.         rbrickb2[0] = rbrickb2[0]+ 110
  3724.         rbrickb3 = list(rbrickbody)
  3725.         rbrickb3[0] = rbrickb3[0]- 110
  3726.         rbrickb4 = list(rbrickbody)
  3727.         rbrickb4[0] = rbrickb4[0]- 210
  3728.         hpbody.top = windowSurface.get_rect().top - 300
  3729.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  3730.         hpb = list(hpbody)
  3731.         hpb2 = list(hpbody)
  3732.         hpb2[0] = hpb[0]+ 80
  3733.         epbody.top = windowSurface.get_rect().top - 100
  3734.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3735.         epb = list(epbody)
  3736.         epb2 = list(epbody)
  3737.         epb2[0] = epb[0]+ 60
  3738.        
  3739.  
  3740.  
  3741.         if choice1:
  3742.             st1brick.append(brickb)
  3743.             st1brick.append(brickb2)
  3744.             st1brick.append(brickb3)
  3745.             st1brick.append(brickb4)
  3746.  
  3747.         if choice2:
  3748.             st3brick.append(hbrickb)
  3749.             st3brick.append(hbrickb2)
  3750.             st3brick.append(hbrickb3)
  3751.  
  3752.            
  3753.  
  3754.         if choice3:
  3755.             st4brick.append(sbrickb)
  3756.             st4brick.append(sbrickb2)
  3757.             st4brick.append(sbrickb3)
  3758.             st4brick.append(sbrickb4)
  3759.             st4brick.append(sbrickb5)
  3760.            
  3761.            
  3762.         if choice4:
  3763.             st2brick.append(ibrickb)
  3764.             st2brick.append(ibrickb2)
  3765.             st2brick.append(ibrickb3)
  3766.  
  3767.         if choice5:
  3768.             st5brick.append(rbrickb)
  3769.             st5brick.append(rbrickb2)
  3770.             st5brick.append(rbrickb3)
  3771.             st5brick.append(rbrickb4)
  3772.            
  3773.         if choiceh:
  3774.             st1hp.append(hpb)
  3775.             st1hp.append(hpb2)
  3776.  
  3777.  
  3778.         if choicee:
  3779.             st1ep.append(epb)
  3780.             st1ep.append(epb2)
  3781.  
  3782.    
  3783.  
  3784.  
  3785.     if stageiteration % 70 == 0 and level == 9 and stageiteration > 2025:
  3786.         x = 0
  3787.         if stageiteration in [2030, 2170, 3010]:
  3788.             x = 0
  3789.             choice5 = True
  3790.         if stageiteration in [2590, 3080, 3500]:
  3791.             x = 150
  3792.             choice2 = True
  3793.         if stageiteration in [2380]:
  3794.             choice2 = True
  3795.             x = 80
  3796.         if stageiteration in [2660, 2800, 3640]:
  3797.             x = -80
  3798.             choice5 = True
  3799.         if stageiteration in [2100, 3220, 3990, 3360, 3850]:
  3800.             x = -150
  3801.             choice4 = True
  3802.         if stageiteration in [2310, 2870, 3430, 3570]:
  3803.             choice3 = True
  3804.             x = -80
  3805.         if stageiteration in [2450, 2940]:
  3806.             x = 30
  3807.             choice3 = True
  3808.         if stageiteration in [2520, 3150, 3920, 3780, 3290, 3710]:
  3809.             choice4 = True
  3810.             x = -30
  3811.         if stageiteration in [2240]:
  3812.             choiceh = True
  3813.             hx = -80
  3814.         if stageiteration in [2030, 3080, 3500, 2730]:
  3815.             choice5 = True
  3816.             x = -80  
  3817.  
  3818.         if stageiteration in [2590]:
  3819.             choiceh = 1
  3820.             choicee = 0
  3821.             choice = 0
  3822.             hx = -20
  3823.         if stageiteration in [3500]:
  3824.             choicee = 1
  3825.             choiceh = 0
  3826.             choice = 0
  3827.             ex = -30
  3828.  
  3829.            
  3830.         hbrickbody.top = windowSurface.get_rect().top
  3831.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3832.         hbrickb = list(hbrickbody)
  3833.         hbrickb2 = list(hbrickbody)
  3834.         hbrickb2[0] = hbrickb2[0]+ 110
  3835.         hbrickb3 = list(hbrickbody)
  3836.         hbrickb3[0] = hbrickb3[0]- 110
  3837.         brickbody.top = windowSurface.get_rect().top
  3838.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3839.         brickb = list(brickbody)
  3840.         brickb2 = list(brickbody)
  3841.         brickb2[0] = brickb2[0]+ 110
  3842.         brickb3 = list(brickbody)
  3843.         brickb3[0] = brickb3[0]- 110
  3844.         brickb4 = list(brickbody)
  3845.         brickb4[0] = brickb4[0]+ 220
  3846.         sbrickbody.top = windowSurface.get_rect().top
  3847.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  3848.         sbrickb = list(sbrickbody)
  3849.         sbrickb2 = list(sbrickbody)
  3850.         sbrickb2[0] = sbrickb2[0]+ 64
  3851.         sbrickb3 = list(sbrickbody)
  3852.         sbrickb3[0] = sbrickb3[0]- 64
  3853.         sbrickb4 = list(sbrickbody)
  3854.         sbrickb4[0] = sbrickb4[0]- 128
  3855.         sbrickb5 = list(sbrickbody)
  3856.         sbrickb5[0] = sbrickb5[0]+ 128
  3857.         ibrickbody.top = windowSurface.get_rect().top
  3858.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  3859.         ibrickb = list(ibrickbody)
  3860.         ibrickb2 = list(ibrickbody)
  3861.         ibrickb2[0] = ibrickb2[0]+ 110
  3862.         ibrickb3 = list(ibrickbody)
  3863.         ibrickb3[0] = ibrickb3[0]- 110
  3864.         rbrickb = list(rbrickbody)
  3865.         rbrickb2 = list(rbrickbody)
  3866.         rbrickb2[0] = rbrickb2[0]+ 110
  3867.         rbrickb3 = list(rbrickbody)
  3868.         rbrickb3[0] = rbrickb3[0]- 110
  3869.         rbrickb4 = list(rbrickbody)
  3870.         rbrickb4[0] = rbrickb4[0]+ 220
  3871.         hpbody.top = windowSurface.get_rect().top - 300
  3872.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  3873.         hpb = list(hpbody)
  3874.         hpb2 = list(hpbody)
  3875.         hpb2[0] = hpb[0]+ 80
  3876.         epbody.top = windowSurface.get_rect().top - 100
  3877.         epbody.centerx = windowSurface.get_rect().centerx + ex
  3878.         epb = list(epbody)
  3879.         epb2 = list(epbody)
  3880.         epb2[0] = epb[0]+ 60
  3881.        
  3882.  
  3883.  
  3884.         if choice1:
  3885.             st1brick.append(brickb)
  3886.             st1brick.append(brickb2)
  3887.             st1brick.append(brickb3)
  3888.             st1brick.append(brickb4)
  3889.  
  3890.         if choice2:
  3891.             st3brick.append(hbrickb)
  3892.             st3brick.append(hbrickb2)
  3893.             st3brick.append(hbrickb3)
  3894.  
  3895.            
  3896.  
  3897.         if choice3:
  3898.             st4brick.append(sbrickb)
  3899.             st4brick.append(sbrickb2)
  3900.             st4brick.append(sbrickb3)
  3901.             st4brick.append(sbrickb4)
  3902.             st4brick.append(sbrickb5)
  3903.  
  3904.            
  3905.         if choice4:
  3906.             st2brick.append(ibrickb)
  3907.             st2brick.append(ibrickb2)
  3908.             st2brick.append(ibrickb3)
  3909.  
  3910.         if choice5:
  3911.             st5brick.append(rbrickb)
  3912.             st5brick.append(rbrickb2)
  3913.             st5brick.append(rbrickb3)
  3914.             st5brick.append(rbrickb4)
  3915.         if choiceh:
  3916.             st1hp.append(hpb)
  3917.             st1hp.append(hpb2)
  3918.  
  3919.  
  3920.         if choicee:
  3921.             st1ep.append(epb)
  3922.             st1ep.append(epb2)
  3923.     if stageiteration == 4200 and level == 9:
  3924.         level = 10
  3925.         stageiteration = 0
  3926.         windowSurface.fill(black)
  3927.         textstage2 = basicfont.render('stage 10', True, (255, 255, 255), (0 , 0 , 0))
  3928.         tstage2rect= textstage2.get_rect()
  3929.         tstage2rect.centerx = windowSurface.get_rect().centerx
  3930.         tstage2rect.centery = windowSurface.get_rect().centery
  3931.         windowSurface.blit(textstage2, tstage2rect)
  3932.         pygame.display.update()
  3933.         sleep(3)
  3934.         lives = 20
  3935.         movedirx = 0
  3936.         energyint = 71
  3937.              
  3938. #________________________________________stage 9__End_____________________________:
  3939.         #_______________________________stage 10_____________________________________:
  3940.  
  3941.  
  3942.  
  3943.     if stageiteration % 70 == 0 and level == 10 and stageiteration < 2001:
  3944.         x = 0
  3945.         if stageiteration in [1050, 1120, 1680, 1960]:
  3946.             x = -90
  3947.             choice4 = True
  3948.         if stageiteration in [70, 140, 770, 1470]:
  3949.             x = -10
  3950.             choice1 = True
  3951.         if stageiteration in [630, 910, 1330, 1750]:
  3952.             choice2 = True
  3953.             x = -80
  3954.         if stageiteration in [210, 420, 1190]:
  3955.             x = 5
  3956.             choice3 = True
  3957.         if stageiteration in [490, 1540, 1890]:
  3958.             x = -130
  3959.             choice3 = True
  3960.         if stageiteration in [280, 1260, 1610, 1820]:
  3961.             choice3 = True
  3962.             x = 90
  3963.         if stageiteration in [350, 840, 980]:
  3964.             x = 120
  3965.             choice4 = True
  3966.         if stageiteration in [560, 1400, 700]:
  3967.             choice4 = True
  3968.             x = 0
  3969.         if stageiteration in []:
  3970.             choiceh = True
  3971.             hx = -80
  3972.         if stageiteration in []:
  3973.             choice1 = True
  3974.             x = -80  
  3975.  
  3976.         if stageiteration in []:
  3977.             choiceh = True
  3978.  
  3979.             hx = -40
  3980.         if stageiteration in []:
  3981.             choicee = True
  3982.  
  3983.             ex = -30
  3984.  
  3985.            
  3986.         hbrickbody.top = windowSurface.get_rect().top
  3987.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  3988.         hbrickb = list(hbrickbody)
  3989.         hbrickb2 = list(hbrickbody)
  3990.         hbrickb2[0] = hbrickb2[0]+ 110
  3991.         hbrickb3 = list(hbrickbody)
  3992.         hbrickb3[0] = hbrickb3[0]- 110
  3993.         hbrickb4 = list(hbrickbody)
  3994.         hbrickb4[0] = hbrickb4[0]- 220
  3995.         brickbody.top = windowSurface.get_rect().top
  3996.         brickbody.centerx = windowSurface.get_rect().centerx + x
  3997.         brickb = list(brickbody)
  3998.         brickb2 = list(brickbody)
  3999.         brickb2[0] = brickb2[0]+ 110
  4000.         brickb3 = list(brickbody)
  4001.         brickb3[0] = brickb3[0]- 110
  4002.         brickb4 = list(brickbody)
  4003.         brickb4[0] = brickb4[0]+ 220
  4004.         brickb5 = list(brickbody)
  4005.         brickb5[0] = brickb5[0]- 220
  4006.         brickb6 = list(brickbody)
  4007.         brickb6[0] = brickb6[0]- 220
  4008.         sbrickbody.top = windowSurface.get_rect().top
  4009.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  4010.         sbrickb = list(sbrickbody)
  4011.         sbrickb2 = list(sbrickbody)
  4012.         sbrickb2[0] = sbrickb2[0]+ 64
  4013.         sbrickb3 = list(sbrickbody)
  4014.         sbrickb3[0] = sbrickb3[0]- 64
  4015.         sbrickb4 = list(sbrickbody)
  4016.         sbrickb4[0] = sbrickb4[0]- 128
  4017.         sbrickb5 = list(sbrickbody)
  4018.         sbrickb5[0] = sbrickb5[0]+ 128
  4019.         sbrickb6 = list(sbrickbody)
  4020.         sbrickb6[0] = sbrickb6[0]+ 192
  4021.         sbrickb7 = list(sbrickbody)
  4022.         sbrickb7[0] = sbrickb6[0]- 192
  4023.         ibrickbody.top = windowSurface.get_rect().top
  4024.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  4025.         ibrickb = list(ibrickbody)
  4026.         ibrickb2 = list(ibrickbody)
  4027.         ibrickb2[0] = ibrickb2[0]+ 110
  4028.         ibrickb3 = list(ibrickbody)
  4029.         ibrickb3[0] = ibrickb3[0]- 110
  4030.         rbrickb = list(rbrickbody)
  4031.         rbrickb2 = list(rbrickbody)
  4032.         rbrickb2[0] = rbrickb2[0]+ 110
  4033.         rbrickb3 = list(rbrickbody)
  4034.         rbrickb3[0] = rbrickb3[0]- 110
  4035.         rbrickb4 = list(rbrickbody)
  4036.         rbrickb4[0] = rbrickb4[0]- 210
  4037.         hpbody.top = windowSurface.get_rect().top - 300
  4038.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  4039.         hpb = list(hpbody)
  4040.         hpb2 = list(hpbody)
  4041.         hpb2[0] = hpb[0]+ 80
  4042.         epbody.top = windowSurface.get_rect().top - 100
  4043.         epbody.centerx = windowSurface.get_rect().centerx + ex
  4044.         epb = list(epbody)
  4045.         epb2 = list(epbody)
  4046.         epb2[0] = epb[0]+ 60
  4047.        
  4048.  
  4049.  
  4050.         if choice1:
  4051.             st1brick.append(brickb)
  4052.             st1brick.append(brickb2)
  4053.             st1brick.append(brickb3)
  4054.             st1brick.append(brickb4)
  4055.             st1brick.append(brickb5)
  4056.             st1brick.append(brickb6)
  4057.  
  4058.         if choice2:
  4059.             st3brick.append(hbrickb)
  4060.             st3brick.append(hbrickb2)
  4061.             st3brick.append(hbrickb3)
  4062.  
  4063.            
  4064.  
  4065.         if choice3:
  4066.             st4brick.append(sbrickb)
  4067.             st4brick.append(sbrickb2)
  4068.             st4brick.append(sbrickb3)
  4069.             st4brick.append(sbrickb4)
  4070.             st4brick.append(sbrickb5)
  4071.             st4brick.append(sbrickb6)
  4072.             st4brick.append(sbrickb7)
  4073.            
  4074.         if choice4:
  4075.             st2brick.append(ibrickb)
  4076.             st2brick.append(ibrickb2)
  4077.             st2brick.append(ibrickb3)
  4078.  
  4079.         if choice5:
  4080.             st5brick.append(rbrickb)
  4081.             st5brick.append(rbrickb2)
  4082.             st5brick.append(rbrickb3)
  4083.             st5brick.append(rbrickb4)
  4084.            
  4085.         if choiceh:
  4086.             st1hp.append(hpb)
  4087.             st1hp.append(hpb2)
  4088.  
  4089.  
  4090.         if choicee:
  4091.             st1ep.append(epb)
  4092.             st1ep.append(epb2)
  4093.  
  4094.    
  4095.  
  4096.  
  4097.     if stageiteration % 70 == 0 and level == 10 and stageiteration > 2025:
  4098.         x = 0
  4099.         if stageiteration in [2030, 2170, 3010]:
  4100.             x = 60
  4101.             choice5 = True
  4102.         if stageiteration in [2590, 3080, 3500]:
  4103.             x = 150
  4104.             choice2 = True
  4105.         if stageiteration in [2380]:
  4106.             choice2 = True
  4107.             x = 80
  4108.         if stageiteration in [2660, 2800, 3640]:
  4109.             x = +30
  4110.             choice5 = True
  4111.         if stageiteration in [2100, 3220, 3990, 3360, 3850]:
  4112.             x = -150
  4113.             choice4 = True
  4114.         if stageiteration in [2310, 2870, 3430, 3570]:
  4115.             choice3 = True
  4116.             x = -80
  4117.         if stageiteration in [2450, 2940]:
  4118.             x = 30
  4119.             choice3 = True
  4120.         if stageiteration in [2520, 3150, 3920, 3780, 3290, 3710]:
  4121.             choice4 = True
  4122.             x = -30
  4123.         if stageiteration in [2240]:
  4124.             choiceh = True
  4125.             hx = -80
  4126.         if stageiteration in [2030, 3080, 3500, 2730]:
  4127.             choice5 = True
  4128.             x = +90  
  4129.  
  4130.         if stageiteration in [2590]:
  4131.             choiceh = 1
  4132.             choicee = 0
  4133.             choice = 0
  4134.             hx = -20
  4135.         if stageiteration in []:
  4136.             choicee = 1
  4137.             choiceh = 0
  4138.             choice = 0
  4139.             ex = -30
  4140.  
  4141.            
  4142.         hbrickbody.top = windowSurface.get_rect().top
  4143.         hbrickbody.centerx = windowSurface.get_rect().centerx + x
  4144.         hbrickb = list(hbrickbody)
  4145.         hbrickb2 = list(hbrickbody)
  4146.         hbrickb2[0] = hbrickb2[0]+ 110
  4147.         hbrickb3 = list(hbrickbody)
  4148.         hbrickb3[0] = hbrickb3[0]- 110
  4149.         brickbody.top = windowSurface.get_rect().top
  4150.         brickbody.centerx = windowSurface.get_rect().centerx + x
  4151.         brickb = list(brickbody)
  4152.         brickb2 = list(brickbody)
  4153.         brickb2[0] = brickb2[0]+ 110
  4154.         brickb3 = list(brickbody)
  4155.         brickb3[0] = brickb3[0]- 110
  4156.         brickb4 = list(brickbody)
  4157.         brickb4[0] = brickb4[0]+ 220
  4158.         sbrickbody.top = windowSurface.get_rect().top
  4159.         sbrickbody.centerx = windowSurface.get_rect().centerx + x
  4160.         sbrickb = list(sbrickbody)
  4161.         sbrickb2 = list(sbrickbody)
  4162.         sbrickb2[0] = sbrickb2[0]+ 64
  4163.         sbrickb3 = list(sbrickbody)
  4164.         sbrickb3[0] = sbrickb3[0]- 64
  4165.         sbrickb4 = list(sbrickbody)
  4166.         sbrickb4[0] = sbrickb4[0]- 128
  4167.         sbrickb5 = list(sbrickbody)
  4168.         sbrickb5[0] = sbrickb5[0]+ 128
  4169.         sbrickb6 = list(sbrickbody)
  4170.         sbrickb6[0] = sbrickb6[0]+ 192
  4171.         ibrickbody.top = windowSurface.get_rect().top
  4172.         ibrickbody.centerx = windowSurface.get_rect().centerx + x
  4173.         ibrickb = list(ibrickbody)
  4174.         ibrickb2 = list(ibrickbody)
  4175.         ibrickb2[0] = ibrickb2[0]+ 110
  4176.         ibrickb3 = list(ibrickbody)
  4177.         ibrickb3[0] = ibrickb3[0]- 110
  4178.         rbrickb = list(rbrickbody)
  4179.         rbrickb2 = list(rbrickbody)
  4180.         rbrickb2[0] = rbrickb2[0]+ 110
  4181.         rbrickb3 = list(rbrickbody)
  4182.         rbrickb3[0] = rbrickb3[0]- 110
  4183.         rbrickb4 = list(rbrickbody)
  4184.         rbrickb4[0] = rbrickb4[0]+ 220
  4185.         hpbody.top = windowSurface.get_rect().top - 300
  4186.         hpbody.centerx = windowSurface.get_rect().centerx + hx
  4187.         hpb = list(hpbody)
  4188.         hpb2 = list(hpbody)
  4189.         hpb2[0] = hpb[0]+ 80
  4190.         epbody.top = windowSurface.get_rect().top - 100
  4191.         epbody.centerx = windowSurface.get_rect().centerx + ex
  4192.         epb = list(epbody)
  4193.         epb2 = list(epbody)
  4194.         epb2[0] = epb[0]+ 60
  4195.        
  4196.  
  4197.  
  4198.         if choice1:
  4199.             st1brick.append(brickb)
  4200.             st1brick.append(brickb2)
  4201.             st1brick.append(brickb3)
  4202.             st1brick.append(brickb4)
  4203.  
  4204.         if choice2:
  4205.             st3brick.append(hbrickb)
  4206.             st3brick.append(hbrickb2)
  4207.             st3brick.append(hbrickb3)
  4208.  
  4209.            
  4210.  
  4211.         if choice3:
  4212.             st4brick.append(sbrickb)
  4213.             st4brick.append(sbrickb2)
  4214.             st4brick.append(sbrickb3)
  4215.             st4brick.append(sbrickb4)
  4216.             st4brick.append(sbrickb5)
  4217.             st4brick.append(sbrickb6)
  4218.            
  4219.         if choice4:
  4220.             st2brick.append(ibrickb)
  4221.             st2brick.append(ibrickb2)
  4222.             st2brick.append(ibrickb3)
  4223.  
  4224.         if choice5:
  4225.             st5brick.append(rbrickb)
  4226.             st5brick.append(rbrickb2)
  4227.             st5brick.append(rbrickb3)
  4228.             st5brick.append(rbrickb4)
  4229.         if choiceh:
  4230.             st1hp.append(hpb)
  4231.             st1hp.append(hpb2)
  4232.  
  4233.  
  4234.         if choicee:
  4235.             st1ep.append(epb)
  4236.             st1ep.append(epb2)
  4237.     if stageiteration == 4200 and level == 10:
  4238.         level = 11
  4239.         stageiteration = 0
  4240.         windowSurface.fill(black)
  4241.         textstage2 = basicfont.render('The End', True, (255, 255, 255), (0 , 0 , 0))
  4242.         tstage2rect= textstage2.get_rect()
  4243.         tstage2rect.centerx = windowSurface.get_rect().centerx
  4244.         tstage2rect.centery = windowSurface.get_rect().centery
  4245.         windowSurface.blit(textstage2, tstage2rect)
  4246.         pygame.display.update()
  4247.         sleep(3)
  4248.         lives = 20
  4249.         movedirx = 0
  4250.         energyint = 71
  4251.              
  4252. #________________________________________stage 10__End_____________________________:
  4253.  
  4254.        
  4255.     choiceh = None
  4256.     choicee = None
  4257.     choice1 = None
  4258.     choice2 = None
  4259.     choice3 = None
  4260.     choice4 = None
  4261.     choice5 = None
  4262.     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