Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.65 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. #Sound
  19. music = pygame.mixer.music.load('jotaro.mp3')
  20. timestop = pygame.mixer.Sound('zawordu.wav')
  21. pygame.mixer.music.play(-1)
  22.  
  23. pygame.mixer.music.set_volume(0.2)
  24. pygame.mixer.music.pause()
  25.  
  26.  
  27.  
  28. #classes and definitions
  29. class player(object):
  30. def __init__(self, x, y, width, height):
  31. self.x = x
  32. self.y = y
  33. self.width = width
  34. self.height = height
  35. self.vel = 15
  36. self.hitbox = (137, self.y, self.width, self.height)
  37. self.walkcount = 0
  38. self.fallcount = 0
  39. def draw(self, win):#Animation
  40. if viga == 0:
  41. if self.fallcount == 20:
  42. win.blit(fall[6], (self.x,self.y))
  43. if self.fallcount < 20:
  44. win.blit(fall[self.fallcount//3], (self.x,self.y))
  45. self.fallcount += 1
  46. if standing:
  47. win.blit(idle[self.walkcount//3], (self.x,self.y))
  48. self.walkcount += 1
  49. if self.walkcount == 47:#14 on 1 v6rra v2iksem kui 3 korda (piltide arv)
  50. self.walkcount = 0
  51. self.hitbox = (137, self.y, self.width, self.height)
  52. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  53.  
  54. def hit(self):
  55. print('hit')
  56. self.score += 85
  57.  
  58.  
  59. #texts
  60. class textbox1(object):
  61. def __init__(self,x,y,width,height):
  62. self.x = x
  63. self.y = y
  64. self.width = width
  65. self.height = height
  66. self.vel = 6
  67. self.hitbox = (self.x, self.y, self.width, self.height)
  68.  
  69. def draw(self, win):
  70. text = font.render('the', 1, (255,255,255))
  71. win.blit(text, (self.x, self.y))
  72. self.hitbox = (self.x, self.y, self.width, self.height)
  73. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  74.  
  75. class textbox2(object):
  76. def __init__(self,x,y,width,height):
  77. self.x = x
  78. self.y = y
  79. self.width = width
  80. self.height = height
  81. self.vel = 6
  82. self.hitbox = (self.x, self.y, self.width, self.height)
  83.  
  84. def draw(self, win):
  85. text = font.render('an', 1, (255,255,255))
  86. win.blit(text, (self.x, self.y))
  87. self.hitbox = (self.x, self.y, self.width, self.height)
  88. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  89.  
  90. class textbox3(object):
  91. def __init__(self,x,y,width,height):
  92. self.x = x
  93. self.y = y
  94. self.width = width
  95. self.height = height
  96. self.vel = 6
  97. self.hitbox = (self.x, self.y, self.width, self.height)
  98.  
  99. def draw(self, win):
  100. text = font.render('a', 1, (255,255,255))
  101. win.blit(text, (self.x, self.y))
  102. self.hitbox = (self.x, self.y, self.width, self.height)
  103. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  104.  
  105. class textbox4(object):
  106. def __init__(self,x,y,width,height):
  107. self.x = x
  108. self.y = y
  109. self.width = width
  110. self.height = height
  111. self.vel = 6
  112. self.hitbox = (self.x, self.y, self.width, self.height)
  113.  
  114. def draw(self, win):
  115. text = font.render('No article', 1, (255,255,255))
  116. win.blit(text, (self.x, self.y))
  117. self.hitbox = (self.x, self.y, self.width, self.height)
  118. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  119.  
  120. #class textbox5(object):
  121. #def __init__(self,x,y,width,height):
  122. #self.x = x
  123. #self.y = y
  124. #self.width = width
  125. #self.height = height
  126. #self.vel = 6
  127. #self.hitbox = (self.x, self.y, self.width, self.height)
  128.  
  129. #def draw(self, win):
  130. #self.hitbox = (self.x, self.y, self.width, self.height)
  131. #pygame.draw.rect(win, (255,0,0), (self.hitbox), 2)
  132.  
  133. class text1(object):
  134. def __init__(self,x,y,width,height):
  135. self.x = x
  136. self.y = y
  137. self.width = width
  138. self.height = height
  139. self.hitbox = (self.x, self.y, self.width, self.height)
  140.  
  141. def draw(self, win):
  142. win.blit(text1, (self.x, self.y))
  143. self.hitbox = (self.x, self.y, self.width, self.height)
  144. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  145.  
  146. class score(object):
  147. def __init__(self,x,y,width,height):
  148. self.x = x
  149. self.y = y
  150. self.width = width
  151. self.height = height
  152. self.hitbox = (self.x, self.y, self.width, self.height)
  153.  
  154. def draw(self, win):
  155. text = font.render('Score: ' + str(man.score), 1, (255,255,255))
  156. win.blit(text, (self.x, self.y))
  157. self.hitbox = (self.x, self.y, self.width, self.height)
  158. #pygame.draw.rect(win, (255,0,0), self.hitbox, 2)
  159.  
  160. #textbox
  161. class startspeech(object):
  162. def __init__(self,x,y):
  163. self.x = x
  164. self.y = y
  165.  
  166. def draw(self, win):
  167. if article1.x > 2529 and article1.x < 2535:
  168. text = font2.render("H", 1, (0,0,0))
  169. win.blit(text, (self.x, self.y))
  170. if article1.x > 2523 and article1.x < 2529:
  171. text = font2.render("HA", 1, (0,0,0))
  172. win.blit(text, (self.x, self.y))
  173. if article1.x > 2517 and article1.x < 2523:
  174. text = font2.render("HAH", 1, (0,0,0))
  175. win.blit(text, (self.x, self.y))
  176. if article1.x > 2511 and article1.x < 2517:
  177. text = font2.render("HAHA", 1, (0,0,0))
  178. win.blit(text, (self.x, self.y))
  179. if article1.x > 2505 and article1.x < 2511:
  180. text = font2.render("HAHAH", 1, (0,0,0))
  181. win.blit(text, (self.x, self.y))
  182. if article1.x > 2499 and article1.x < 2505:
  183. text = font2.render("HAHAHA", 1, (0,0,0))
  184. win.blit(text, (self.x, self.y))
  185. if article1.x > 2493 and article1.x < 2499:
  186. text = font2.render("HAHAHA!", 1, (0,0,0))
  187. win.blit(text, (self.x, self.y))
  188. if article1.x > 2487 and article1.x < 2493:
  189. text = font2.render("HAHAHA! Y", 1, (0,0,0))
  190. win.blit(text, (self.x, self.y))
  191. if article1.x > 2481 and article1.x < 2487:
  192. text = font2.render("HAHAHA! Yo", 1, (0,0,0))
  193. win.blit(text, (self.x, self.y))
  194. if article1.x > 2475 and article1.x < 2481:
  195. text = font2.render("HAHAHA! You", 1, (0,0,0))
  196. win.blit(text, (self.x, self.y))
  197. if article1.x > 2469 and article1.x < 2475:
  198. text = font2.render("HAHAHA! You c", 1, (0,0,0))
  199. win.blit(text, (self.x, self.y))
  200. if article1.x > 2463 and article1.x < 2469:
  201. text = font2.render("HAHAHA! You ca", 1, (0,0,0))
  202. win.blit(text, (self.x, self.y))
  203. if article1.x > 2457 and article1.x < 2463:
  204. text = font2.render("HAHAHA! You can", 1, (0,0,0))
  205. win.blit(text, (self.x, self.y))
  206. if article1.x > 2451 and article1.x < 2457:
  207. text = font2.render("HAHAHA! You can n", 1, (0,0,0))
  208. win.blit(text, (self.x, self.y))
  209. if article1.x > 2445 and article1.x < 2451:
  210. text = font2.render("HAHAHA! You can ne", 1, (0,0,0))
  211. win.blit(text, (self.x, self.y))
  212. if article1.x > 2439 and article1.x < 2445:
  213. text = font2.render("HAHAHA! You can nev", 1, (0,0,0))
  214. win.blit(text, (self.x, self.y))
  215. if article1.x > 2433 and article1.x < 2439:
  216. text = font2.render("HAHAHA! You can neve", 1, (0,0,0))
  217. win.blit(text, (self.x, self.y))
  218. if article1.x > 2427 and article1.x < 2433:
  219. text = font2.render("HAHAHA! You can never", 1, (0,0,0))
  220. win.blit(text, (self.x, self.y))
  221. if article1.x > 2421 and article1.x < 2427:
  222. text = font2.render("HAHAHA! You can never d", 1, (0,0,0))
  223. win.blit(text, (self.x, self.y))
  224. if article1.x > 2415 and article1.x < 2421:
  225. text = font2.render("HAHAHA! You can never de", 1, (0,0,0))
  226. win.blit(text, (self.x, self.y))
  227. if article1.x > 2409 and article1.x < 2415:
  228. text = font2.render("HAHAHA! You can never def", 1, (0,0,0))
  229. win.blit(text, (self.x, self.y))
  230. if article1.x > 2403 and article1.x < 2409:
  231. text = font2.render("HAHAHA! You can never defe", 1, (0,0,0))
  232. win.blit(text, (self.x, self.y))
  233. if article1.x > 2397 and article1.x < 2403:
  234. text = font2.render("HAHAHA! You can never defea", 1, (0,0,0))
  235. win.blit(text, (self.x, self.y))
  236. if article1.x > 2391 and article1.x < 2397:
  237. text = font2.render("HAHAHA! You can never defeat", 1, (0,0,0))
  238. win.blit(text, (self.x, self.y))
  239. if article1.x > 2385 and article1.x < 2391:
  240. text = font2.render("HAHAHA! You can never defeat m", 1, (0,0,0))
  241. win.blit(text, (self.x, self.y))
  242. if article1.x > 2379 and article1.x < 2385:
  243. text = font2.render("HAHAHA! You can never defeat me", 1, (0,0,0))
  244. win.blit(text, (self.x, self.y))
  245. if article1.x > 2373 and article1.x < 2379:
  246. text = font2.render("HAHAHA! You can never defeat me,", 1, (0,0,0))
  247. win.blit(text, (self.x, self.y))
  248. if article1.x > 2367 and article1.x < 2373:
  249. text = font2.render("HAHAHA! You can never defeat me, D", 1, (0,0,0))
  250. win.blit(text, (self.x, self.y))
  251. if article1.x > 2361 and article1.x < 2367:
  252. text = font2.render("HAHAHA! You can never defeat me, DI", 1, (0,0,0))
  253. win.blit(text, (self.x, self.y))
  254. if article1.x > 2355 and article1.x < 2361:
  255. text = font2.render("HAHAHA! You can never defeat me, DIO", 1, (0,0,0))
  256. win.blit(text, (self.x, self.y))
  257. if article1.x > 2349 and article1.x < 2355:
  258. text = font2.render("HAHAHA! You can never defeat me, DIO,", 1, (0,0,0))
  259. win.blit(text, (self.x, self.y))
  260. if article1.x > 2343 and article1.x < 2349:
  261. text = font2.render("HAHAHA! You can never defeat me, DIO, a", 1, (0,0,0))
  262. win.blit(text, (self.x, self.y))
  263. if article1.x > 2337 and article1.x < 2343:
  264. text = font2.render("HAHAHA! You can never defeat me, DIO, an", 1, (0,0,0))
  265. win.blit(text, (self.x, self.y))
  266. if article1.x > 2331 and article1.x < 2337:
  267. text = font2.render("HAHAHA! You can never defeat me, DIO, and", 1, (0,0,0))
  268. win.blit(text, (self.x, self.y))
  269. if article1.x > 2325 and article1.x < 2331:
  270. text = font2.render("HAHAHA! You can never defeat me, DIO, and m", 1, (0,0,0))
  271. win.blit(text, (self.x, self.y))
  272. if article1.x > 2319 and article1.x < 2325:
  273. text = font2.render("HAHAHA! You can never defeat me, DIO, and my", 1, (0,0,0))
  274. win.blit(text, (self.x, self.y))
  275. if article1.x > 2313 and article1.x < 2319:
  276. text = font2.render("HAHAHA! You can never defeat me, DIO, and my a", 1, (0,0,0))
  277. win.blit(text, (self.x, self.y))
  278. if article1.x > 2307 and article1.x < 2313:
  279. text = font2.render("HAHAHA! You can never defeat me, DIO, and my ar", 1, (0,0,0))
  280. win.blit(text, (self.x, self.y))
  281. if article1.x > 2301 and article1.x < 2307:
  282. text = font2.render("HAHAHA! You can never defeat me, DIO, and my arm", 1, (0,0,0))
  283. win.blit(text, (self.x, self.y))
  284. if article1.x > 2295 and article1.x < 2301:
  285. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army", 1, (0,0,0))
  286. win.blit(text, (self.x, self.y))
  287. if article1.x > 2289 and article1.x < 2295:
  288. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army o", 1, (0,0,0))
  289. win.blit(text, (self.x, self.y))
  290. if article1.x > 2283 and article1.x < 2289:
  291. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of", 1, (0,0,0))
  292. win.blit(text, (self.x, self.y))
  293. if article1.x > 2277 and article1.x < 2283:
  294. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of a", 1, (0,0,0))
  295. win.blit(text, (self.x, self.y))
  296. if article1.x > 2263 and article1.x < 2277:
  297. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of ar", 1, (0,0,0))
  298. win.blit(text, (self.x, self.y))
  299. if article1.x > 2257 and article1.x < 2263:
  300. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of art", 1, (0,0,0))
  301. win.blit(text, (self.x, self.y))
  302. if article1.x > 2251 and article1.x < 2257:
  303. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of arti", 1, (0,0,0))
  304. win.blit(text, (self.x, self.y))
  305. if article1.x > 2245 and article1.x < 2251:
  306. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of artic", 1, (0,0,0))
  307. win.blit(text, (self.x, self.y))
  308. if article1.x > 2239 and article1.x < 2245:
  309. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articl", 1, (0,0,0))
  310. win.blit(text, (self.x, self.y))
  311. if article1.x > 2233 and article1.x < 2239:
  312. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of article", 1, (0,0,0))
  313. win.blit(text, (self.x, self.y))
  314. if article1.x > 2227 and article1.x < 2233:
  315. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articles", 1, (0,0,0))
  316. win.blit(text, (self.x, self.y))
  317. if article1.x > 1900 and article1.x < 2227:
  318. text = font2.render("HAHAHA! You can never defeat me, DIO, and my army of articles.", 1, (0,0,0))
  319. win.blit(text, (self.x, self.y))
  320.  
  321.  
  322. #ylesanne
  323. class task(object):
  324. def __init__(self,x,y):
  325. self.x = x
  326. self.y = y
  327.  
  328. def draw(self, win):
  329. if article1.x > 1900 and article1.x < 2227:
  330. text = font.render('In order to defeat DIO', 1, (255,255,255))
  331. win.blit(text, (self.x, self.y))
  332.  
  333. class task2(object):
  334. def __init__(self,x,y):
  335. self.x = x
  336. self.y = y
  337.  
  338. def draw(self, win):
  339. if article1.x > 1900 and article1.x < 2227:
  340. text = font.render('you must destroy the', 1, (255,255,255))
  341. win.blit(text, (self.x, self.y))
  342.  
  343. class task3(object):
  344. def __init__(self,x,y):
  345. self.x = x
  346. self.y = y
  347.  
  348. def draw(self, win):
  349. if article1.x > 1900 and article1.x < 2227:
  350. text = font.render('grammatically correct articles', 1, (255,255,255))
  351. win.blit(text, (self.x, self.y))
  352.  
  353. class endspeech(object):
  354. def __init__(self,x,y):
  355. self.x = x
  356. self.y = y
  357. self.endlause = "M"
  358. def draw(self, win):
  359. if viga == 0:
  360. text = font2.render("MUDA! MUDA! MUDA! You're still making too many grammar mistakes!", 1, (0,0,0))
  361. win.blit(text, (self.x, self.y))
  362.  
  363.  
  364. #vale vastus
  365.  
  366.  
  367. #6ige vastus
  368. #class answer(object):
  369. #def __init__(self,x,y):
  370. #self.x = x
  371. #self.y = y
  372. #def draw(self, win):
  373. #if valik in the:
  374. #word = "[THE]"
  375. #elif valik in an:
  376. #word = "[AN]"
  377. #elif valik in a:
  378. #word = "[A]"
  379. #elif valik in empty:
  380. #word = "[NO ARTICLE]"
  381. #if articlevale and article1.x > 1200:
  382. #text = font.render('The correct article was ' + (word), 1, (255,255,255))
  383. #win.blit(text, (self.x, self.y))
  384.  
  385.  
  386. #pop up classes
  387. class boss(object):
  388. def __init__(self, x, y,):
  389. self.x = x
  390. self.y = y
  391. def draw(self, win):
  392. if article1.x > 1900 and article1.x < 2535 or viga == 0:
  393. win.blit(dio, (self.x,self.y))
  394. man.vel = 0
  395. pygame.mixer.music.pause()
  396. elif article1.x < 1900:
  397. man.vel = 15
  398. pygame.mixer.music.unpause()
  399.  
  400. class talk(object):
  401. def __init__(self, x, y):
  402. self.x = x
  403. self.y = y
  404. def draw(self, win):
  405. if article1.x > 1900 and article1.x < 2535 or viga == 0:
  406. win.blit(tb, (self.x,self.y))
  407.  
  408. class darkmode(object):
  409. def __init__(self, x, y):
  410. self.x = x
  411. self.y = y
  412. def draw(self, win):
  413. if article1.x > 1900 and article1.x < 2535 or viga == 0:
  414. win.blit(darken, (self.x,self.y))
  415.  
  416. class combocounter(object):
  417. def __init__(self,x,y,width,height):
  418. self.x = x
  419. self.y = y
  420. self.width = width
  421. self.height = height
  422. def draw(self, win):
  423. text = font.render('Combo: ' + str(combo) + "x", 1, (255,255,255))
  424. win.blit(text, (self.x, self.y))
  425.  
  426. #SÜDAMED
  427. class heart(object):
  428. def __init__(self,x,y,):
  429. self.x = x
  430. self.y = y
  431. self.visible = True
  432. def draw(self, win):
  433. if self.visible:
  434. win.blit(life, (self.x, self.y))
  435.  
  436. class heart2(object):
  437. def __init__(self,x,y):
  438. self.x = x
  439. self.y = y
  440. self.visible2 = True
  441. def draw(self, win):
  442. if self.visible2:
  443. win.blit(life, (self.x, self.y))
  444.  
  445. class heart3(object):
  446. def __init__(self,x,y):
  447. self.x = x
  448. self.y = y
  449. self.visible3 = True
  450. def draw(self, win):
  451. if self.visible3:
  452. win.blit(life, (self.x, self.y))
  453.  
  454.  
  455. def level():
  456. article1.vel += 1.5
  457. article2.vel += 1.5
  458. article3.vel += 1.5
  459. article4.vel += 1.5
  460.  
  461. def combobonus():
  462. bonus = combo * 15
  463. man.score +=bonus
  464.  
  465.  
  466. def drawgamewindow():
  467. win.blit(bg,(0,0))
  468. article1.draw(win)
  469. article2.draw(win)
  470. article3.draw(win)
  471. article4.draw(win)
  472. #article5.draw(win)
  473. text2.draw(win)
  474. text3.draw(win)
  475. #fail.draw(win)
  476. elu.draw(win)
  477. elu2.draw(win)
  478. elu3.draw(win)
  479. combowombo.draw(win)
  480. must.draw(win)
  481. man.draw(win)
  482. enemy.draw(win)
  483. speech.draw(win)
  484. speech1.draw(win)
  485. speech2.draw(win)
  486. goal.draw(win)
  487. goal2.draw(win)
  488. goal3.draw(win)
  489. pygame.display.update()
  490.  
  491.  
  492. #k6ik vajalik
  493. 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.","Ally has visited … Netherlands.","… dress she is wearing is pink."," … general’s army attacked the village at dawn.","She is … prettiest girl at school.","That’s … best part of my day!","… programs I watch are for children."," Felicity is … kind of girl who is very passionate.","I usually wash … dishes at home.","That’s bad for … environment, I think.","I get information from … Internet."]
  494. 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.","I have … idea! Let’s go bowling.","My sister is … English teacher.","New York is … exciting city!","He is … honest man.","She used to work as … FBI agent.","Mark once met … alien from outer space.","I work at … office.","There was … accident at work.","My sister had a baby so I became … uncle.","Could you buy … ice cream cone for me?",""]
  495. 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.","Janet Jackson is … great singer!","My parents gave me … football for my birthday."," He is … real gentleman.","Casper is … student. "," I’m … little excited because it’s Friday today.","There are … lot of good shows on TV today.","I went to my room and read … book for 30 minutes.","Natalie met … famous actor on the bus yesterday.","Hallie has … job interview today. ","He once saved … cat from … fire.","She was wearing … green sweater. "]
  496. 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.","I have borrowed … money from her before.","… French is a difficult language to learn.","Tomorrow I will fly to … Japan.","Tony climbed Mount Everest.","My mom doesn’t watch … TV.","I’m interested in … finance.","After … dinner, I help my parents to clean up.","I waste a lot of … water when I shower.","Molly is still in … college.","The last time I saw her was in … September.","This cartoon is about … animals.","Dad is making … pancakes for breakfast!","I turn off the lights and go to … bed.","I moved last year to … Canada."]
  497. laused = [the, an, a, empty]
  498. run = True
  499. article1 = textbox1(3000, 125, 1, 25)
  500. article2 = textbox2(3000, 275, 1, 25)
  501. article3 = textbox3(3000, 425, 1, 25)
  502. article4 = textbox4(3000, 575, 1, 25)
  503. #article5 = textbox5(3000, 600, 1, 25)
  504. #articlevale = False
  505. suvaline = random.choice(laused)
  506. text2 = text1(100, 50, 100, 50)
  507. valik = random.choice(suvaline)
  508. text1 = font.render(valik, 1, (255,255,255))
  509. text3 = score(100, 668, 100, 50)
  510. man = player(100, 300, 65, 125)
  511. elu = heart(500, 630)
  512. elu2 = heart2(542, 630)
  513. elu3 = heart3(584, 630)
  514. enemy = boss(1000, 400)
  515. speech = talk(750, 515)
  516. speech1 = startspeech(830, 580)
  517. speech2 = endspeech(830, 580)
  518. goal = task(400, 200)
  519. goal2 = task2(400, 250)
  520. goal3 = task3(400, 300)
  521. combowombo = combocounter(300, 668, 65, 125)
  522. #fail = answer(470, 668)
  523. must = darkmode(0,0)
  524. man.score = 0
  525. viga = 3
  526. combo = 0
  527. standing = True
  528.  
  529.  
  530.  
  531.  
  532. #mainloop
  533. while run:
  534. pygame.time.delay(20)
  535.  
  536. for event in pygame.event.get():
  537. if event.type == pygame.QUIT:
  538. run = False
  539.  
  540. #artiklite liikumine ja muu tegevus
  541. article1.x -= article1.vel
  542. article2.x -= article2.vel
  543. article3.x -= article2.vel
  544. article4.x -= article2.vel
  545. #article5.x -= article2.vel
  546.  
  547.  
  548. if article1.x > 2555 and article1.x < 2560:
  549. timestop.play()
  550.  
  551. #artikkel 1 liikumine
  552. if article1.y - article1.height < man.hitbox[1] + man.hitbox[3] and article1.y + article1.height > man.hitbox[1]:
  553. if article1.x + article1.width > man.hitbox[0] and article1.x < man.hitbox[0] + man.hitbox[2]:
  554. print('1')
  555. if suvaline == (the):
  556. print('6IGE')
  557. man.hit()
  558. article1.x = 1900
  559. article2.x = 1900
  560. article3.x = 1900
  561. article4.x = 1900
  562. suvaline = random.choice(laused)
  563. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  564. level()
  565. combo += 1
  566. combobonus()
  567. else:
  568. print('vale')
  569. #articlevale = True
  570. article1.x = 1900
  571. article2.x = 1900
  572. article3.x = 1900
  573. article4.x = 1900
  574. #article5.x = 3000
  575. combo = 0
  576. viga -= 1
  577. if viga == 0:
  578. standing = False
  579. article1.vel = 6
  580. article2.vel = 6
  581. article3.vel = 6
  582. article4.vel = 6
  583. article1.x = 10000
  584. article2.x = 10000
  585. article3.x = 10000
  586. article4.x = 10000
  587. if article1.x == 4000:
  588. article1.vel = 0
  589. article2.vel = 0
  590. article3.vel = 0
  591. article4.vel = 0
  592. else:
  593. suvaline = random.choice(laused)
  594. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  595. if viga == 2:
  596. elu3.visible3 = False
  597. elif viga == 1:
  598. elu2.visible2 = False
  599. elu3.visible3 = False
  600. else:
  601. elu.visible = False
  602. elu2.visible2 = False
  603. elu3.visible3 = False
  604.  
  605. #artikkel 2 liikumine
  606. if article2.y - article2.height < man.hitbox[1] + man.hitbox[3] and article2.y + article2.height > man.hitbox[1]:
  607. if article2.x + article2.width > man.hitbox[0] and article2.x < man.hitbox[0] + man.hitbox[2]:
  608. print('2')
  609. if suvaline == (an):
  610. print('6IGE')
  611. man.hit()
  612. article1.x = 1900
  613. article2.x = 1900
  614. article3.x = 1900
  615. article4.x = 1900
  616. suvaline = random.choice(laused)
  617. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  618. level()
  619. combo += 1
  620. combobonus()
  621. else:
  622. print('vale')
  623. #articlevale = True
  624. article1.x = 1900
  625. article2.x = 1900
  626. article3.x = 1900
  627. article4.x = 1900
  628. #article5.x = 3000
  629. combo = 0
  630. viga -= 1
  631. if viga == 0:
  632. standing = False
  633. article1.vel = 6
  634. article2.vel = 6
  635. article3.vel = 6
  636. article4.vel = 6
  637. article1.x = 10000
  638. article2.x = 10000
  639. article3.x = 10000
  640. article4.x = 10000
  641. if article1.x == 4000:
  642. article1.vel = 0
  643. article2.vel = 0
  644. article3.vel = 0
  645. article4.vel = 0
  646. else:
  647. suvaline = random.choice(laused)
  648. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  649. if viga == 2:
  650. elu3.visible3 = False
  651. elif viga == 1:
  652. elu2.visible2 = False
  653. elu3.visible3 = False
  654. else:
  655. elu.visible = False
  656. elu2.visible2 = False
  657. elu3.visible3 = False
  658.  
  659. #artikkel 3 liikumine
  660. if article3.y - article3.height < man.hitbox[1] + man.hitbox[3] and article3.y + article3.height > man.hitbox[1]:
  661. if article3.x + article3.width > man.hitbox[0] and article3.x < man.hitbox[0] + man.hitbox[2]:
  662. print('3')
  663. if suvaline == (a):
  664. print('6IGE')
  665. man.hit()
  666. article1.x = 1900
  667. article2.x = 1900
  668. article3.x = 1900
  669. article4.x = 1900
  670. suvaline = random.choice(laused)
  671. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  672. level()
  673. combo += 1
  674. combobonus()
  675. else:
  676. print('vale')
  677. #articlevale = True
  678. article1.x = 1900
  679. article2.x = 1900
  680. article3.x = 1900
  681. article4.x = 1900
  682. #article5.x = 3000
  683. combo = 0
  684. viga -= 1
  685. if viga == 0:
  686. standing = False
  687. article1.vel = 6
  688. article2.vel = 6
  689. article3.vel = 6
  690. article4.vel = 6
  691. article1.x = 10000
  692. article2.x = 10000
  693. article3.x = 10000
  694. article4.x = 10000
  695. if article1.x == 4000:
  696. article1.vel = 0
  697. article2.vel = 0
  698. article3.vel = 0
  699. article4.vel = 0
  700. else:
  701. suvaline = random.choice(laused)
  702. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  703. if viga == 2:
  704. elu3.visible3 = False
  705. elif viga == 1:
  706. elu2.visible2 = False
  707. elu3.visible3 = False
  708. else:
  709. elu.visible = False
  710. elu2.visible2 = False
  711. elu3.visible3 = False
  712.  
  713. #artikkel 4 liikumine
  714. if article4.y - article4.height < man.hitbox[1] + man.hitbox[3] and article4.y + article4.height > man.hitbox[1]:
  715. if article4.x + article4.width > man.hitbox[0] and article4.x < man.hitbox[0] + man.hitbox[2]:
  716. print('4')
  717. if suvaline == (empty):
  718. print('6IGE')
  719. man.hit()
  720. article1.x = 1900
  721. article2.x = 1900
  722. article3.x = 1900
  723. article4.x = 1900
  724. suvaline = random.choice(laused)
  725. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  726. level()
  727. combo += 1
  728. combobonus()
  729. else:
  730. print('vale')
  731.  
  732. #articlevale = True
  733. article1.x = 1900
  734. article2.x = 1900
  735. article3.x = 1900
  736. article4.x = 1900
  737. #article5.x = 3000
  738. combo = 0
  739. viga -= 1
  740. if viga == 0:
  741. standing = False
  742. article1.vel = 6
  743. article2.vel = 6
  744. article3.vel = 6
  745. article4.vel = 6
  746. article1.x = 10000
  747. article2.x = 10000
  748. article3.x = 10000
  749. article4.x = 10000
  750. if article1.x == 4000:
  751. article1.vel = 0
  752. article2.vel = 0
  753. article3.vel = 0
  754. article4.vel = 0
  755. else:
  756. suvaline = random.choice(laused)
  757. text1 = font.render(random.choice(suvaline), 1, (255,255,255))
  758. if viga == 2:
  759. elu3.visible3 = False
  760. elif viga == 1:
  761. elu2.visible2 = False
  762. elu3.visible3 = False
  763. else:
  764. elu.visible = False
  765. elu2.visible2 = False
  766. elu3.visible3 = False
  767.  
  768.  
  769. #player movement
  770. keys = pygame.key.get_pressed()
  771.  
  772. if keys[pygame.K_w] and man.y > man.vel + 69 or keys[pygame.K_UP] and man.y > man.vel + 69:
  773. man.y -= man.vel
  774.  
  775. 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:
  776. man.y += man.vel
  777.  
  778.  
  779. drawgamewindow()
  780.  
  781.  
  782.  
  783.  
  784. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement