Advertisement
LegitBrainless

Untitled

Mar 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.36 KB | None | 0 0
  1. import pygame
  2. import random
  3. pygame.init()
  4.  
  5.  
  6. #Graphics
  7. win = pygame.display.set_mode((1800, 768), pygame.RESIZABLE)
  8. pygame.display.set_caption("Jotaro's revenge")
  9. bg = pygame.image.load('bg.png')
  10. life = pygame.image.load('heart.png')
  11. dio = pygame.image.load('dio.png')
  12. tb = pygame.image.load('pinktb.png')
  13. font = pygame.font.SysFont('comicsans', 40, True)
  14. font2 = pygame.font.SysFont('comicsans', 20, True)
  15. idle = [pygame.image.load('jojo1.png'), pygame.image.load('jojo2.png'), pygame.image.load('jojo3.png'), pygame.image.load('jojo4.png'), pygame.image.load('jojo5.png'), pygame.image.load('jojo6.png'), pygame.image.load('jojo7.png'), pygame.image.load('jojo8.png'), pygame.image.load('jojo9.png'), pygame.image.load('jojo10.png'), pygame.image.load('jojo11.png'), pygame.image.load('jojo12.png'), pygame.image.load('jojo13.png'), pygame.image.load('jojo14.png'), pygame.image.load('jojo15.png'), pygame.image.load('jojo16.png')]
  16. darken = pygame.image.load('darken.png')
  17. fall = [pygame.image.load('fall1.png'), pygame.image.load('fall2.png'), pygame.image.load('fall3.png'), pygame.image.load('fall4.png'), pygame.image.load('fall5.png'), pygame.image.load('fall6.png'), pygame.image.load('fall7.png')]
  18. red = pygame.image.load("red.png")
  19. #Sound
  20. music = pygame.mixer.music.load('jotaro.mp3')
  21. timestop = pygame.mixer.Sound('zawordu.wav')
  22. pygame.mixer.music.play(-1)
  23.  
  24. pygame.mixer.music.set_volume(0.2)
  25. pygame.mixer.music.pause()
  26.  
  27.  
  28.  
  29. #classes and definitions
  30. class player(object):
  31. def __init__(self, x, y, width, height):
  32. self.x = x
  33. self.y = y
  34. self.width = width
  35. self.height = height
  36. self.vel = 15
  37. self.hitbox = (137, self.y, self.width, self.height)
  38. self.walkcount = 0
  39. self.fallcount = 0
  40. def draw(self, win):#Animation
  41. if viga == 0:
  42. if self.fallcount == 20:
  43. win.blit(fall[6], (self.x,self.y))
  44. if self.fallcount < 20:
  45. win.blit(fall[self.fallcount//3], (self.x,self.y))
  46. self.fallcount += 1
  47. if standing:
  48. win.blit(idle[self.walkcount//3], (self.x,self.y))
  49. self.walkcount += 1
  50. if self.walkcount == 47:#14 on 1 v6rra v2iksem kui 3 korda (piltide arv)
  51. self.walkcount = 0
  52. self.hitbox = (137, self.y, self.width, self.height)
  53. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  54.  
  55. def hit(self):
  56. print('hit')
  57. self.score += 85
  58.  
  59.  
  60. #texts
  61. class textbox1(object):
  62. def __init__(self,x,y,width,height):
  63. self.x = x
  64. self.y = y
  65. self.width = width
  66. self.height = height
  67. self.vel = 6
  68. self.hitbox = (self.x, self.y, self.width, self.height)
  69.  
  70. def draw(self, win):
  71. text = font.render('the', 1, (255,255,255))
  72. win.blit(text, (self.x, self.y))
  73. self.hitbox = (self.x, self.y, self.width, self.height)
  74. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  75.  
  76. class textbox2(object):
  77. def __init__(self,x,y,width,height):
  78. self.x = x
  79. self.y = y
  80. self.width = width
  81. self.height = height
  82. self.vel = 6
  83. self.hitbox = (self.x, self.y, self.width, self.height)
  84.  
  85. def draw(self, win):
  86. text = font.render('an', 1, (255,255,255))
  87. win.blit(text, (self.x, self.y))
  88. self.hitbox = (self.x, self.y, self.width, self.height)
  89. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  90.  
  91. class textbox3(object):
  92. def __init__(self,x,y,width,height):
  93. self.x = x
  94. self.y = y
  95. self.width = width
  96. self.height = height
  97. self.vel = 6
  98. self.hitbox = (self.x, self.y, self.width, self.height)
  99.  
  100. def draw(self, win):
  101. text = font.render('a', 1, (255,255,255))
  102. win.blit(text, (self.x, self.y))
  103. self.hitbox = (self.x, self.y, self.width, self.height)
  104. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  105.  
  106. class textbox4(object):
  107. def __init__(self,x,y,width,height):
  108. self.x = x
  109. self.y = y
  110. self.width = width
  111. self.height = height
  112. self.vel = 6
  113. self.hitbox = (self.x, self.y, self.width, self.height)
  114.  
  115. def draw(self, win):
  116. text = font.render('No article', 1, (255,255,255))
  117. win.blit(text, (self.x, self.y))
  118. self.hitbox = (self.x, self.y, self.width, self.height)
  119. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  120.  
  121. #class textbox5(object):
  122. #def __init__(self,x,y,width,height):
  123. #self.x = x
  124. #self.y = y
  125. #self.width = width
  126. #self.height = height
  127. #self.vel = 6
  128. #self.hitbox = (self.x, self.y, self.width, self.height)
  129.  
  130. #def draw(self, win):
  131. #self.hitbox = (self.x, self.y, self.width, self.height)
  132. #pygame.draw.rect(win, (255,0,0), (self.hitbox), 2)
  133.  
  134. class text1(object):
  135. def __init__(self,x,y,width,height):
  136. self.x = x
  137. self.y = y
  138. self.width = width
  139. self.height = height
  140. self.hitbox = (self.x, self.y, self.width, self.height)
  141.  
  142. def draw(self, win):
  143. win.blit(text1, (self.x, self.y))
  144. self.hitbox = (self.x, self.y, self.width, self.height)
  145. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  146.  
  147. class score(object):
  148. def __init__(self,x,y,width,height):
  149. self.x = x
  150. self.y = y
  151. self.width = width
  152. self.height = height
  153. self.hitbox = (self.x, self.y, self.width, self.height)
  154.  
  155. def draw(self, win):
  156. text = font.render('Score: ' + str(man.score), 1, (255,255,255))
  157. win.blit(text, (self.x, self.y))
  158. self.hitbox = (self.x, self.y, self.width, self.height)
  159. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  160.  
  161. #textbox
  162. class startspeech(object):
  163. def __init__(self,x,y):
  164. self.x = x
  165. self.y = y
  166.  
  167. def draw(self, win):
  168. if article1.x > 2529 and article1.x < 2535:
  169. text = font2.render("H", 1, (0,0,0))
  170. win.blit(text, (self.x, self.y))
  171. if article1.x > 2523 and article1.x < 2529:
  172. text = font2.render("HA", 1, (0,0,0))
  173. win.blit(text, (self.x, self.y))
  174. if article1.x > 2517 and article1.x < 2523:
  175. text = font2.render("HAH", 1, (0,0,0))
  176. win.blit(text, (self.x, self.y))
  177. if article1.x > 2511 and article1.x < 2517:
  178. text = font2.render("HAHA", 1, (0,0,0))
  179. win.blit(text, (self.x, self.y))
  180. if article1.x > 2505 and article1.x < 2511:
  181. text = font2.render("HAHAH", 1, (0,0,0))
  182. win.blit(text, (self.x, self.y))
  183. if article1.x > 2499 and article1.x < 2505:
  184. text = font2.render("HAHAHA", 1, (0,0,0))
  185. win.blit(text, (self.x, self.y))
  186. if article1.x > 2493 and article1.x < 2499:
  187. text = font2.render("HAHAHA!", 1, (0,0,0))
  188. win.blit(text, (self.x, self.y))
  189. if article1.x > 2487 and article1.x < 2493:
  190. text = font2.render("HAHAHA! Y", 1, (0,0,0))
  191. win.blit(text, (self.x, self.y))
  192. if article1.x > 2481 and article1.x < 2487:
  193. text = font2.render("HAHAHA! Yo", 1, (0,0,0))
  194. win.blit(text, (self.x, self.y))
  195. if article1.x > 2475 and article1.x < 2481:
  196. text = font2.render("HAHAHA! You", 1, (0,0,0))
  197. win.blit(text, (self.x, self.y))
  198. if article1.x > 2469 and article1.x < 2475:
  199. text = font2.render("HAHAHA! You c", 1, (0,0,0))
  200. win.blit(text, (self.x, self.y))
  201. if article1.x > 2463 and article1.x < 2469:
  202. text = font2.render("HAHAHA! You ca", 1, (0,0,0))
  203. win.blit(text, (self.x, self.y))
  204. if article1.x > 2457 and article1.x < 2463:
  205. text = font2.render("HAHAHA! You can", 1, (0,0,0))
  206. win.blit(text, (self.x, self.y))
  207. if article1.x > 2451 and article1.x < 2457:
  208. text = font2.render("HAHAHA! You can n", 1, (0,0,0))
  209. win.blit(text, (self.x, self.y))
  210. if article1.x > 2445 and article1.x < 2451:
  211. text = font2.render("HAHAHA! You can ne", 1, (0,0,0))
  212. win.blit(text, (self.x, self.y))
  213. if article1.x > 2439 and article1.x < 2445:
  214. text = font2.render("HAHAHA! You can nev", 1, (0,0,0))
  215. win.blit(text, (self.x, self.y))
  216. if article1.x > 2433 and article1.x < 2439:
  217. text = font2.render("HAHAHA! You can neve", 1, (0,0,0))
  218. win.blit(text, (self.x, self.y))
  219. if article1.x > 2427 and article1.x < 2433:
  220. text = font2.render("HAHAHA! You can never", 1, (0,0,0))
  221. win.blit(text, (self.x, self.y))
  222. if article1.x > 2421 and article1.x < 2427:
  223. text = font2.render("HAHAHA! You can never d", 1, (0,0,0))
  224. win.blit(text, (self.x, self.y))
  225. if article1.x > 2415 and article1.x < 2421:
  226. text = font2.render("HAHAHA! You can never de", 1, (0,0,0))
  227. win.blit(text, (self.x, self.y))
  228. if article1.x > 2409 and article1.x < 2415:
  229. text = font2.render("HAHAHA! You can never def", 1, (0,0,0))
  230. win.blit(text, (self.x, self.y))
  231. if article1.x > 2403 and article1.x < 2409:
  232. text = font2.render("HAHAHA! You can never defe", 1, (0,0,0))
  233. win.blit(text, (self.x, self.y))
  234. if article1.x > 2397 and article1.x < 2403:
  235. text = font2.render("HAHAHA! You can never defea", 1, (0,0,0))
  236. win.blit(text, (self.x, self.y))
  237. if article1.x > 2391 and article1.x < 2397:
  238. text = font2.render("HAHAHA! You can never defeat", 1, (0,0,0))
  239. win.blit(text, (self.x, self.y))
  240. if article1.x > 2385 and article1.x < 2391:
  241. text = font2.render("HAHAHA! You can never defeat m", 1, (0,0,0))
  242. win.blit(text, (self.x, self.y))
  243. if article1.x > 2379 and article1.x < 2385:
  244. text = font2.render("HAHAHA! You can never defeat me", 1, (0,0,0))
  245. win.blit(text, (self.x, self.y))
  246. if article1.x > 2373 and article1.x < 2379:
  247. text = font2.render("HAHAHA! You can never defeat me,", 1, (0,0,0))
  248. win.blit(text, (self.x, self.y))
  249. if article1.x > 2367 and article1.x < 2373:
  250. text = font2.render("HAHAHA! You can never defeat me, D", 1, (0,0,0))
  251. win.blit(text, (self.x, self.y))
  252. if article1.x > 2361 and article1.x < 2367:
  253. text = font2.render("HAHAHA! You can never defeat me, DI", 1, (0,0,0))
  254. win.blit(text, (self.x, self.y))
  255. if article1.x > 2355 and article1.x < 2361:
  256. text = font2.render("HAHAHA! You can never defeat me, DIO", 1, (0,0,0))
  257. win.blit(text, (self.x, self.y))
  258. if article1.x > 2349 and article1.x < 2355:
  259. text = font2.render("HAHAHA! You can never defeat me, DIO,", 1, (0,0,0))
  260. win.blit(text, (self.x, self.y))
  261. if article1.x > 2343 and article1.x < 2349:
  262. text = font2.render("HAHAHA! You can never defeat me, DIO, a", 1, (0,0,0))
  263. win.blit(text, (self.x, self.y))
  264. if article1.x > 2337 and article1.x < 2343:
  265. text = font2.render("HAHAHA! You can never defeat me, DIO, an", 1, (0,0,0))
  266. win.blit(text, (self.x, self.y))
  267. if article1.x > 2331 and article1.x < 2337:
  268. text = font2.render("HAHAHA! You can never defeat me, DIO, and", 1, (0,0,0))
  269. win.blit(text, (self.x, self.y))
  270. if article1.x > 2325 and article1.x < 2331:
  271. text = font2.render("HAHAHA! You can never defeat me, DIO, and m", 1, (0,0,0))
  272. win.blit(text, (self.x, self.y))
  273. if article1.x > 2319 and article1.x < 2325:
  274. text = font2.render("HAHAHA! You can never defeat me, DIO, and my", 1, (0,0,0))
  275. win.blit(text, (self.x, self.y))
  276. if article1.x > 2313 and article1.x < 2319:
  277. text = font2.render("HAHAHA! You can never defeat me, DIO, and my a", 1, (0,0,0))
  278. win.blit(text, (self.x, self.y))
  279. if article1.x > 2307 and article1.x < 2313:
  280. text = font2.render("HAHAHA! You can never defeat me, DIO, and my ar", 1, (0,0,0))
  281. win.blit(text, (self.x, self.y))
  282. if article1.x > 2301 and article1.x < 2307:
  283. text = font2.render("HAHAHA! You can never defeat me, DIO, and my arm", 1, (0,0,0))
  284. win.blit(text, (self.x, self.y))
  285. if article1.x > 2295 and article1.x < 2301:
  286. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army", 1, (0,0,0))
  287. win.blit(text, (self.x, self.y))
  288. if article1.x > 2289 and article1.x < 2295:
  289. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army o", 1, (0,0,0))
  290. win.blit(text, (self.x, self.y))
  291. if article1.x > 2283 and article1.x < 2289:
  292. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of", 1, (0,0,0))
  293. win.blit(text, (self.x, self.y))
  294. if article1.x > 2277 and article1.x < 2283:
  295. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of a", 1, (0,0,0))
  296. win.blit(text, (self.x, self.y))
  297. if article1.x > 2263 and article1.x < 2277:
  298. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of ar", 1, (0,0,0))
  299. win.blit(text, (self.x, self.y))
  300. if article1.x > 2257 and article1.x < 2263:
  301. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of art", 1, (0,0,0))
  302. win.blit(text, (self.x, self.y))
  303. if article1.x > 2251 and article1.x < 2257:
  304. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of arti", 1, (0,0,0))
  305. win.blit(text, (self.x, self.y))
  306. if article1.x > 2245 and article1.x < 2251:
  307. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of artic", 1, (0,0,0))
  308. win.blit(text, (self.x, self.y))
  309. if article1.x > 2239 and article1.x < 2245:
  310. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articl", 1, (0,0,0))
  311. win.blit(text, (self.x, self.y))
  312. if article1.x > 2233 and article1.x < 2239:
  313. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of article", 1, (0,0,0))
  314. win.blit(text, (self.x, self.y))
  315. if article1.x > 2227 and article1.x < 2233:
  316. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articles", 1, (0,0,0))
  317. win.blit(text, (self.x, self.y))
  318. if article1.x > 1900 and article1.x < 2227:
  319. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articles.", 1, (0,0,0))
  320. win.blit(text, (self.x, self.y))
  321.  
  322.  
  323. #ylesanne
  324. class task(object):
  325. def __init__(self,x,y):
  326. self.x = x
  327. self.y = y
  328.  
  329. def draw(self, win):
  330. if article1.x > 1900 and article1.x < 2227:
  331. text = font.render('In order to defeat DIO', 1, (255,255,255))
  332. win.blit(text, (self.x, self.y))
  333.  
  334. class task2(object):
  335. def __init__(self,x,y):
  336. self.x = x
  337. self.y = y
  338.  
  339. def draw(self, win):
  340. if article1.x > 1900 and article1.x < 2227:
  341. text = font.render('you must destroy the', 1, (255,255,255))
  342. win.blit(text, (self.x, self.y))
  343.  
  344. class task3(object):
  345. def __init__(self,x,y):
  346. self.x = x
  347. self.y = y
  348.  
  349. def draw(self, win):
  350. if article1.x > 1900 and article1.x < 2227:
  351. text = font.render('grammatically correct articles', 1, (255,255,255))
  352. win.blit(text, (self.x, self.y))
  353.  
  354. class endspeech(object):
  355. def __init__(self,x,y):
  356. self.x = x
  357. self.y = y
  358. self.endlause = "M"
  359. def draw(self, win):
  360. if viga == 0:
  361. text = font2.render("MUDA! MUDA! MUDA! You're still making too many grammar mistakes!", 1, (0,0,0))
  362. win.blit(text, (self.x, self.y))
  363.  
  364.  
  365. #vale vastus
  366. class valevastus(object):
  367. def __init__(self,x,y):
  368. self.x = x
  369. self.y = y
  370. self.acceptable = 3
  371. def draw(self,win):
  372. if article1.x < 1900 and article1.x >1890 and viga < self.acceptable:
  373. win.blit(red, (self.x, self.y))
  374. if article1.x < 1880 and article1.x >1870 and viga < self.acceptable:
  375. win.blit(red, (self.x, self.y))
  376. self.acceptable -=1
  377.  
  378. #6ige vastus
  379. #class answer(object):
  380. #def __init__(self,x,y):
  381. #self.x = x
  382. #self.y = y
  383. #def draw(self, win):
  384. #if valik in the:
  385. #word = "[THE]"
  386. #elif valik in an:
  387. #word = "[AN]"
  388. #elif valik in a:
  389. #word = "[A]"
  390. #elif valik in empty:
  391. #word = "[NO ARTICLE]"
  392. #if articlevale and article1.x > 1200:
  393. #text = font.render('The correct article was ' + (word), 1, (255,255,255))
  394. #win.blit(text, (self.x, self.y))
  395.  
  396.  
  397. #pop up classes
  398. class boss(object):
  399. def __init__(self, x, y,):
  400. self.x = x
  401. self.y = y
  402. def draw(self, win):
  403. if article1.x > 1900 and article1.x < 2535 or viga == 0:
  404. win.blit(dio, (self.x,self.y))
  405. man.vel = 0
  406. pygame.mixer.music.pause()
  407. elif article1.x < 1900:
  408. man.vel = 15
  409. pygame.mixer.music.unpause()
  410.  
  411. class talk(object):
  412. def __init__(self, x, y):
  413. self.x = x
  414. self.y = y
  415. def draw(self, win):
  416. if article1.x > 1900 and article1.x < 2535 or viga == 0:
  417. win.blit(tb, (self.x,self.y))
  418.  
  419. class darkmode(object):
  420. def __init__(self, x, y):
  421. self.x = x
  422. self.y = y
  423. def draw(self, win):
  424. if article1.x > 1900 and article1.x < 2535 or viga == 0:
  425. win.blit(darken, (self.x,self.y))
  426.  
  427. class combocounter(object):
  428. def __init__(self,x,y,width,height):
  429. self.x = x
  430. self.y = y
  431. self.width = width
  432. self.height = height
  433. def draw(self, win):
  434. text = font.render('Combo: ' + str(combo) + "x", 1, (255,255,255))
  435. win.blit(text, (self.x, self.y))
  436.  
  437. #SÜDAMED
  438. class heart(object):
  439. def __init__(self,x,y,):
  440. self.x = x
  441. self.y = y
  442. self.visible = True
  443. def draw(self, win):
  444. if self.visible:
  445. win.blit(life, (self.x, self.y))
  446.  
  447. class heart2(object):
  448. def __init__(self,x,y):
  449. self.x = x
  450. self.y = y
  451. self.visible2 = True
  452. def draw(self, win):
  453. if self.visible2:
  454. win.blit(life, (self.x, self.y))
  455.  
  456. class heart3(object):
  457. def __init__(self,x,y):
  458. self.x = x
  459. self.y = y
  460. self.visible3 = True
  461. def draw(self, win):
  462. if self.visible3:
  463. win.blit(life, (self.x, self.y))
  464.  
  465.  
  466. def level():
  467. article1.vel += 2
  468. article2.vel += 2
  469. article3.vel += 2
  470. article4.vel += 2
  471.  
  472. def combobonus():
  473. bonus = combo * 15
  474. man.score +=bonus
  475.  
  476.  
  477. def drawgamewindow():
  478. win.blit(bg,(0,0))
  479. article1.draw(win)
  480. article2.draw(win)
  481. article3.draw(win)
  482. article4.draw(win)
  483. #article5.draw(win)
  484. text2.draw(win)
  485. text3.draw(win)
  486. #fail.draw(win)
  487. elu.draw(win)
  488. elu2.draw(win)
  489. elu3.draw(win)
  490. combowombo.draw(win)
  491. must.draw(win)
  492. man.draw(win)
  493. blood.draw(win)
  494. enemy.draw(win)
  495. speech.draw(win)
  496. speech1.draw(win)
  497. speech2.draw(win)
  498. goal.draw(win)
  499. goal2.draw(win)
  500. goal3.draw(win)
  501. pygame.display.update()
  502.  
  503.  
  504. #k6ik vajalik
  505. the = ["... Second World War ended in 1945.","Can Nathan play … piano?","Fred always says dogs make … best pets","Many doctors recommend immunization shots to prevent … flu.","She cured … cold by drinking ginger tea.","We spent … whole time listening to boring speeches.","I spent … summer on a beach in Florida.","She thinks that … world is changing quickly.","Do you know … name of her perfume?","I enjoyed … DVD you gave me for my birthday."," … dentist doesn’t have any openings for two months.","Is there any water on … Moon?","When I turned on my new laptop, … screen exploded!","If … price keeps going up, I’m going to buy an electric car.","Every winter, … lake freezes over and we can go ice skating.","I heard that … mall will house a movie theater."]
  506. an = ["Whenever I go swimming, I end up with … earache.","I was on the phone with them for … entire hour!","Researchers hope that beneath the frozen layer lies … ocean.","It is … especially important thing!","If I were rich, I would buy … apartment.","It only took … hour.","Wow! That is … expensive car!","Look, there's … orange on the table.","Karen, you have … unusually small head.","Is there … internet cafe around here?","I need to send … important email.","You should take … umbrella with you.","She baked … enormous steak instead.","Greg and Taylor took … amazing vacation to Sweden last week.","Maddie really is … unhappy person."]
  507. a = ["Do you have … bigger room in the hotel?","She jogs at least four times … week.","We have to find … better way to do this.","This bag is made of … much stronger material than my last one.","That brand of organic coffee costs $90 … pound!","Can you play … musical instrument?","Do you own … Ferrari?","Air should be … universal human right.","He has 3 cats and … horse.","Sammy has … few ideas which could really help us.","She has … few clients, and she isn’t earning very much.","Ned had … stroke last year.","He is from … European country, but I don’t know which one.","Larry doesn’t own … car.","It looks like it’s going to be … rainy day today."]
  508. empty = ["I’m pretty sure … cheetahs are the fastest animals on the planet.","They have … little money for food or education.","Armadillos are most active at … night.","Have you ever heard of … Halloween?","Do you want to meet up for dinner on … Friday?","I didn’t sleep at all … last night.","Welcome to … Tuvana Island!","This school has … great teachers.","I love … stories like that!","Why do … fruit and … vegetables taste so good?","Tina has … few friends. She should meet more people."]
  509. laused = [the, an, a, empty]
  510. run = True
  511. article1 = textbox1(3000, 125, 1, 25)
  512. article2 = textbox2(3000, 275, 1, 25)
  513. article3 = textbox3(3000, 425, 1, 25)
  514. article4 = textbox4(3000, 575, 1, 25)
  515. #article5 = textbox5(3000, 600, 1, 25)
  516. #articlevale = False
  517. suvaline = random.choice(laused)
  518. text2 = text1(100, 50, 100, 50)
  519. valik = random.choice(suvaline)
  520. text1 = font.render(valik, 1, (255,255,255))
  521. text3 = score(100, 668, 100, 50)
  522. man = player(100, 300, 65, 125)
  523. elu = heart(300, 662)
  524. elu2 = heart2(342, 662)
  525. elu3 = heart3(384, 662)
  526. enemy = boss(1000, 400)
  527. speech = talk(750, 515)
  528. speech1 = startspeech(830, 580)
  529. speech2 = endspeech(830, 580)
  530. goal = task(400, 200)
  531. goal2 = task2(400, 250)
  532. goal3 = task3(400, 300)
  533. combowombo = combocounter(100, 705, 65, 125)
  534. #fail = answer(470, 668)
  535. must = darkmode(0,0)
  536. man.score = 0
  537. viga = 3
  538. combo = 0
  539. standing = True
  540. blood = valevastus(0,0)
  541.  
  542.  
  543.  
  544. #mainloop
  545. while run:
  546. pygame.time.delay(20)
  547.  
  548. for event in pygame.event.get():
  549. if event.type == pygame.QUIT:
  550. run = False
  551.  
  552. #artiklite liikumine ja muu tegevus
  553. article1.x -= article1.vel
  554. article2.x -= article2.vel
  555. article3.x -= article2.vel
  556. article4.x -= article2.vel
  557. #article5.x -= article2.vel
  558.  
  559.  
  560. if article1.x > 2555 and article1.x < 2560:
  561. timestop.play()
  562.  
  563. #artikkel 1 liikumine
  564. if article1.y - article1.height < man.hitbox[1] + man.hitbox[3] and article1.y + article1.height > man.hitbox[1]:
  565. if article1.x + article1.width > man.hitbox[0] and article1.x < man.hitbox[0] + man.hitbox[2]:
  566. print('1')
  567. if suvaline == (the):
  568. print('6IGE')
  569. man.hit()
  570. article1.x = 1900
  571. article2.x = 1900
  572. article3.x = 1900
  573. article4.x = 1900
  574. suvaline = random.choice(laused)
  575. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  576. level()
  577. combo += 1
  578. combobonus()
  579. else:
  580. print('vale')
  581. #articlevale = True
  582. article1.x = 1900
  583. article2.x = 1900
  584. article3.x = 1900
  585. article4.x = 1900
  586. #article5.x = 3000
  587. combo = 0
  588. viga -= 1
  589. if viga == 0:
  590. standing = False
  591. article1.vel = 6
  592. article2.vel = 6
  593. article3.vel = 6
  594. article4.vel = 6
  595. article1.x = 10000
  596. article2.x = 10000
  597. article3.x = 10000
  598. article4.x = 10000
  599. if article1.x < 2000:
  600. article1.vel = 0
  601. article2.vel = 0
  602. article3.vel = 0
  603. article4.vel = 0
  604. else:
  605. suvaline = random.choice(laused)
  606. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  607. if viga == 2:
  608. elu3.visible3 = False
  609. elif viga == 1:
  610. elu2.visible2 = False
  611. elu3.visible3 = False
  612. else:
  613. elu.visible = False
  614. elu2.visible2 = False
  615. elu3.visible3 = False
  616.  
  617. #artikkel 2 liikumine
  618. if article2.y - article2.height < man.hitbox[1] + man.hitbox[3] and article2.y + article2.height > man.hitbox[1]:
  619. if article2.x + article2.width > man.hitbox[0] and article2.x < man.hitbox[0] + man.hitbox[2]:
  620. print('2')
  621. if suvaline == (an):
  622. print('6IGE')
  623. man.hit()
  624. article1.x = 1900
  625. article2.x = 1900
  626. article3.x = 1900
  627. article4.x = 1900
  628. suvaline = random.choice(laused)
  629. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  630. level()
  631. combo += 1
  632. combobonus()
  633. else:
  634. print('vale')
  635. #articlevale = True
  636. article1.x = 1900
  637. article2.x = 1900
  638. article3.x = 1900
  639. article4.x = 1900
  640. #article5.x = 3000
  641. combo = 0
  642. viga -= 1
  643. if viga == 0:
  644. standing = False
  645. article1.vel = 6
  646. article2.vel = 6
  647. article3.vel = 6
  648. article4.vel = 6
  649. article1.x = 10000
  650. article2.x = 10000
  651. article3.x = 10000
  652. article4.x = 10000
  653. if article1.x < 2000:
  654. article1.vel = 0
  655. article2.vel = 0
  656. article3.vel = 0
  657. article4.vel = 0
  658. else:
  659. suvaline = random.choice(laused)
  660. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  661. if viga == 2:
  662. elu3.visible3 = False
  663. elif viga == 1:
  664. elu2.visible2 = False
  665. elu3.visible3 = False
  666. else:
  667. elu.visible = False
  668. elu2.visible2 = False
  669. elu3.visible3 = False
  670.  
  671. #artikkel 3 liikumine
  672. if article3.y - article3.height < man.hitbox[1] + man.hitbox[3] and article3.y + article3.height > man.hitbox[1]:
  673. if article3.x + article3.width > man.hitbox[0] and article3.x < man.hitbox[0] + man.hitbox[2]:
  674. print('3')
  675. if suvaline == (a):
  676. print('6IGE')
  677.  
  678. article1.x = 1900
  679. article2.x = 1900
  680. article3.x = 1900
  681. article4.x = 1900
  682. suvaline = random.choice(laused)
  683. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  684. level()
  685. combo += 1
  686. combobonus()
  687. else:
  688. print('vale')
  689. #articlevale = True
  690. article1.x = 1900
  691. article2.x = 1900
  692. article3.x = 1900
  693. article4.x = 1900
  694. #article5.x = 3000
  695. combo = 0
  696. viga -= 1
  697. if viga == 0:
  698. standing = False
  699. article1.vel = 6
  700. article2.vel = 6
  701. article3.vel = 6
  702. article4.vel = 6
  703. article1.x = 10000
  704. article2.x = 10000
  705. article3.x = 10000
  706. article4.x = 10000
  707. if article1.x < 2000:
  708. article1.vel = 0
  709. article2.vel = 0
  710. article3.vel = 0
  711. article4.vel = 0
  712. else:
  713. suvaline = random.choice(laused)
  714. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  715. if viga == 2:
  716. elu3.visible3 = False
  717. elif viga == 1:
  718. elu2.visible2 = False
  719. elu3.visible3 = False
  720. else:
  721. elu.visible = False
  722. elu2.visible2 = False
  723. elu3.visible3 = False
  724.  
  725. #artikkel 4 liikumine
  726. if article4.y - article4.height < man.hitbox[1] + man.hitbox[3] and article4.y + article4.height > man.hitbox[1]:
  727. if article4.x + article4.width > man.hitbox[0] and article4.x < man.hitbox[0] + man.hitbox[2]:
  728. print('4')
  729. if suvaline == (empty):
  730. print('6IGE')
  731. man.hit()
  732. article1.x = 1900
  733. article2.x = 1900
  734. article3.x = 1900
  735. article4.x = 1900
  736. suvaline = random.choice(laused)
  737. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  738. level()
  739. combo += 1
  740. combobonus()
  741. else:
  742. print('vale')
  743.  
  744. #articlevale = True
  745. article1.x = 1900
  746. article2.x = 1900
  747. article3.x = 1900
  748. article4.x = 1900
  749. #article5.x = 3000
  750. combo = 0
  751. viga -= 1
  752. if viga == 0:
  753. standing = False
  754. article1.vel = 6
  755. article2.vel = 6
  756. article3.vel = 6
  757. article4.vel = 6
  758. article1.x = 10000
  759. article2.x = 10000
  760. article3.x = 10000
  761. article4.x = 10000
  762. if article1.x < 2000:
  763. article1.vel = 0
  764. article2.vel = 0
  765. article3.vel = 0
  766. article4.vel = 0
  767. else:
  768. suvaline = random.choice(laused)
  769. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  770. if viga == 2:
  771. elu3.visible3 = False
  772. elif viga == 1:
  773. elu2.visible2 = False
  774. elu3.visible3 = False
  775. else:
  776. elu.visible = False
  777. elu2.visible2 = False
  778. elu3.visible3 = False
  779.  
  780.  
  781. #player movement
  782. keys = pygame.key.get_pressed()
  783.  
  784. if keys[pygame.K_w] and man.y > man.vel + 69 or keys[pygame.K_UP] and man.y > man.vel + 69:
  785. man.y -= man.vel
  786.  
  787. if keys[pygame.K_s] and man.y < 690 - man.height - man.vel or keys[pygame.K_DOWN] and man.y < 690 - man.height - man.vel:
  788. man.y += man.vel
  789.  
  790.  
  791. drawgamewindow()
  792.  
  793.  
  794.  
  795.  
  796. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement