Advertisement
Guest User

Untitled

a guest
Apr 17th, 2024
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.00 KB | None | 0 0
  1. // Snooping through the files now are we?
  2.  
  3. // Compile With: g++ main.cpp loadImage.h playSound.h -lSDL2 -lSDL2_image -lSDL2_mixer -Wall -o "Butter Game"
  4.  
  5. #include <SDL2/SDL.h>
  6. #include <SDL2/SDL_image.h>
  7.  
  8. #include <iostream>
  9.  
  10. SDL_Texture* imageSlot1;
  11. SDL_Texture* imageSlot2;
  12. SDL_Texture* imageSlot3;
  13. SDL_Texture* imageSlot4;
  14. SDL_Texture* imageSlot5;
  15. SDL_Texture* imageSlot6;
  16. SDL_Texture* imageSlot7;
  17. SDL_Texture* imageSlot8;
  18. SDL_Texture* imageSlot9;
  19. SDL_Texture* imageSlot10;
  20.  
  21. SDL_Rect imageRect1;
  22. SDL_Rect imageRect2;
  23. SDL_Rect imageRect3;
  24. SDL_Rect imageRect4;
  25. SDL_Rect imageRect5;
  26. SDL_Rect imageRect6;
  27. SDL_Rect imageRect7;
  28. SDL_Rect imageRect8;
  29. SDL_Rect imageRect9;
  30. SDL_Rect imageRect10;
  31.  
  32. SDL_Rect* hitbox1;
  33. SDL_Rect* hitbox2;
  34. SDL_Rect* hitbox3;
  35. SDL_Rect* hitbox4;
  36. SDL_Rect* hitbox5;
  37. SDL_Rect* hitbox6;
  38. SDL_Rect* hitbox7;
  39. SDL_Rect* hitbox8;
  40. SDL_Rect* hitbox9;
  41. SDL_Rect* hitbox10;
  42. SDL_Rect* hitbox11;
  43. SDL_Rect* hitbox12;
  44. SDL_Rect* hitbox13;
  45. SDL_Rect* hitbox14;
  46. SDL_Rect* hitbox15;
  47. SDL_Rect* hitbox16;
  48. SDL_Rect* hitbox17;
  49. SDL_Rect* hitbox18;
  50. SDL_Rect* hitbox19;
  51. SDL_Rect* hitbox20;
  52.  
  53. int hitboxIndex = 1;
  54.  
  55. int imageIndex = 1;
  56.  
  57. extern SDL_Renderer* renderer;
  58. extern void deleteButtons();
  59.  
  60. int loadImage(const char* path, int posX, int posY, int sizeX, int sizeY)
  61. {
  62. if(imageIndex > 10)
  63. {
  64. imageIndex = 1;
  65. }
  66.  
  67. switch(imageIndex)
  68. {
  69. case 1:
  70. imageRect1.x = posX;
  71. imageRect1.y = posY;
  72. imageRect1.w = sizeX;
  73. imageRect1.h = sizeY;
  74.  
  75. SDL_Surface* surface1;
  76.  
  77. surface1 = IMG_Load(path);
  78.  
  79. imageSlot1 = SDL_CreateTextureFromSurface(renderer, surface1);
  80.  
  81. SDL_FreeSurface(surface1);
  82.  
  83. imageIndex++;
  84.  
  85. std::cout << "imageIndex 1 loaded." << std::endl;
  86.  
  87. break;
  88. case 2:
  89. imageRect2.x = posX;
  90. imageRect2.y = posY;
  91. imageRect2.w = sizeX;
  92. imageRect2.h = sizeY;
  93.  
  94. SDL_Surface* surface2;
  95.  
  96. surface2 = IMG_Load(path);
  97.  
  98. imageSlot2 = SDL_CreateTextureFromSurface(renderer, surface2);
  99.  
  100. SDL_FreeSurface(surface2);
  101.  
  102. imageIndex++;
  103.  
  104. std::cout << "imageIndex 2 loaded." << std::endl;
  105.  
  106. break;
  107. case 3:
  108. imageRect3.x = posX;
  109. imageRect3.y = posY;
  110. imageRect3.w = sizeX;
  111. imageRect3.h = sizeY;
  112.  
  113. SDL_Surface* surface3;
  114.  
  115. surface3 = IMG_Load(path);
  116.  
  117. imageSlot3 = SDL_CreateTextureFromSurface(renderer, surface3);
  118.  
  119. SDL_FreeSurface(surface3);
  120.  
  121. imageIndex++;
  122.  
  123. std::cout << "imageIndex 3 loaded." << std::endl;
  124.  
  125. break;
  126. case 4:
  127. imageRect4.x = posX;
  128. imageRect4.y = posY;
  129. imageRect4.w = sizeX;
  130. imageRect4.h = sizeY;
  131.  
  132. SDL_Surface* surface4;
  133.  
  134. surface4 = IMG_Load(path);
  135.  
  136. imageSlot4 = SDL_CreateTextureFromSurface(renderer, surface4);
  137.  
  138. SDL_FreeSurface(surface4);
  139.  
  140. imageIndex++;
  141.  
  142. std::cout << "imageIndex 4 loaded." << std::endl;
  143.  
  144. break;
  145. case 5:
  146. imageRect5.x = posX;
  147. imageRect5.y = posY;
  148. imageRect5.w = sizeX;
  149. imageRect5.h = sizeY;
  150.  
  151. SDL_Surface* surface5;
  152.  
  153. surface5 = IMG_Load(path);
  154.  
  155. imageSlot5 = SDL_CreateTextureFromSurface(renderer, surface5);
  156.  
  157. SDL_FreeSurface(surface5);
  158.  
  159. imageIndex++;
  160.  
  161. std::cout << "imageIndex 5 loaded." << std::endl;
  162.  
  163. break;
  164. case 6:
  165. imageRect6.x = posX;
  166. imageRect6.y = posY;
  167. imageRect6.w = sizeX;
  168. imageRect6.h = sizeY;
  169.  
  170. SDL_Surface* surface6;
  171.  
  172. surface6 = IMG_Load(path);
  173.  
  174. imageSlot6 = SDL_CreateTextureFromSurface(renderer, surface6);
  175.  
  176. SDL_FreeSurface(surface6);
  177.  
  178. imageIndex++;
  179.  
  180. std::cout << "imageIndex 6 loaded." << std::endl;
  181.  
  182. break;
  183. case 7:
  184. imageRect7.x = posX;
  185. imageRect7.y = posY;
  186. imageRect7.w = sizeX;
  187. imageRect7.h = sizeY;
  188.  
  189. SDL_Surface* surface7;
  190.  
  191. surface7 = IMG_Load(path);
  192.  
  193. imageSlot7 = SDL_CreateTextureFromSurface(renderer, surface7);
  194.  
  195. SDL_FreeSurface(surface7);
  196.  
  197. imageIndex++;
  198.  
  199. std::cout << "imageIndex 7 loaded." << std::endl;
  200.  
  201. break;
  202. case 8:
  203. imageRect8.x = posX;
  204. imageRect8.y = posY;
  205. imageRect8.w = sizeX;
  206. imageRect8.h = sizeY;
  207.  
  208. SDL_Surface* surface8;
  209.  
  210. surface8 = IMG_Load(path);
  211.  
  212. imageSlot8 = SDL_CreateTextureFromSurface(renderer, surface8);
  213.  
  214. SDL_FreeSurface(surface8);
  215.  
  216. imageIndex++;
  217.  
  218. std::cout << "imageIndex 8 loaded." << std::endl;
  219.  
  220. break;
  221. case 9:
  222. imageRect9.x = posX;
  223. imageRect9.y = posY;
  224. imageRect9.w = sizeX;
  225. imageRect9.h = sizeY;
  226.  
  227. SDL_Surface* surface9;
  228.  
  229. surface9 = IMG_Load(path);
  230.  
  231. imageSlot9 = SDL_CreateTextureFromSurface(renderer, surface9);
  232.  
  233. SDL_FreeSurface(surface9);
  234.  
  235. imageIndex++;
  236.  
  237. std::cout << "imageIndex 9 loaded." << std::endl;
  238.  
  239. break;
  240. case 10:
  241. imageRect10.x = posX;
  242. imageRect10.y = posY;
  243. imageRect10.w = sizeX;
  244. imageRect10.h = sizeY;
  245.  
  246. SDL_Surface* surface10;
  247.  
  248. surface10 = IMG_Load(path);
  249.  
  250. imageSlot10 = SDL_CreateTextureFromSurface(renderer, surface10);
  251.  
  252. SDL_FreeSurface(surface10);
  253.  
  254. imageIndex++;
  255.  
  256. std::cout << "imageIndex 10 loaded." << std::endl;
  257.  
  258. break;
  259. }
  260.  
  261. return imageIndex;
  262. }
  263.  
  264. void loadSpecificImageSlot(const char* path, int posX, int posY, int sizeX, int sizeY, int imageSlot)
  265. {
  266. switch(imageSlot)
  267. {
  268. case 1:
  269. imageRect1.x = posX;
  270. imageRect1.y = posY;
  271. imageRect1.w = sizeX;
  272. imageRect1.h = sizeY;
  273.  
  274. SDL_Surface* surface1;
  275.  
  276. surface1 = IMG_Load(path);
  277.  
  278. imageSlot1 = SDL_CreateTextureFromSurface(renderer, surface1);
  279.  
  280. SDL_FreeSurface(surface1);
  281.  
  282. imageIndex++;
  283.  
  284. break;
  285. case 2:
  286. imageRect2.x = posX;
  287. imageRect2.y = posY;
  288. imageRect2.w = sizeX;
  289. imageRect2.h = sizeY;
  290.  
  291. SDL_Surface* surface2;
  292.  
  293. surface2 = IMG_Load(path);
  294.  
  295. imageSlot2 = SDL_CreateTextureFromSurface(renderer, surface2);
  296.  
  297. SDL_FreeSurface(surface2);
  298.  
  299. imageIndex++;
  300.  
  301. break;
  302. case 3:
  303. imageRect3.x = posX;
  304. imageRect3.y = posY;
  305. imageRect3.w = sizeX;
  306. imageRect3.h = sizeY;
  307.  
  308. SDL_Surface* surface3;
  309.  
  310. surface3 = IMG_Load(path);
  311.  
  312. imageSlot3 = SDL_CreateTextureFromSurface(renderer, surface3);
  313.  
  314. SDL_FreeSurface(surface3);
  315.  
  316. imageIndex++;
  317.  
  318. break;
  319. case 4:
  320. imageRect4.x = posX;
  321. imageRect4.y = posY;
  322. imageRect4.w = sizeX;
  323. imageRect4.h = sizeY;
  324.  
  325. SDL_Surface* surface4;
  326.  
  327. surface4 = IMG_Load(path);
  328.  
  329. imageSlot4 = SDL_CreateTextureFromSurface(renderer, surface4);
  330.  
  331. SDL_FreeSurface(surface4);
  332.  
  333. imageIndex++;
  334.  
  335. break;
  336. case 5:
  337. imageRect5.x = posX;
  338. imageRect5.y = posY;
  339. imageRect5.w = sizeX;
  340. imageRect5.h = sizeY;
  341.  
  342. SDL_Surface* surface5;
  343.  
  344. surface5 = IMG_Load(path);
  345.  
  346. imageSlot5 = SDL_CreateTextureFromSurface(renderer, surface5);
  347.  
  348. SDL_FreeSurface(surface5);
  349.  
  350. imageIndex++;
  351.  
  352. break;
  353. case 6:
  354. imageRect6.x = posX;
  355. imageRect6.y = posY;
  356. imageRect6.w = sizeX;
  357. imageRect6.h = sizeY;
  358.  
  359. SDL_Surface* surface6;
  360.  
  361. surface6 = IMG_Load(path);
  362.  
  363. imageSlot6 = SDL_CreateTextureFromSurface(renderer, surface6);
  364.  
  365. SDL_FreeSurface(surface6);
  366.  
  367. imageIndex++;
  368.  
  369. break;
  370. case 7:
  371. imageRect7.x = posX;
  372. imageRect7.y = posY;
  373. imageRect7.w = sizeX;
  374. imageRect7.h = sizeY;
  375.  
  376. SDL_Surface* surface7;
  377.  
  378. surface7 = IMG_Load(path);
  379.  
  380. imageSlot7 = SDL_CreateTextureFromSurface(renderer, surface7);
  381.  
  382. SDL_FreeSurface(surface7);
  383.  
  384. imageIndex++;
  385.  
  386. break;
  387. case 8:
  388. imageRect8.x = posX;
  389. imageRect8.y = posY;
  390. imageRect8.w = sizeX;
  391. imageRect8.h = sizeY;
  392.  
  393. SDL_Surface* surface8;
  394.  
  395. surface8 = IMG_Load(path);
  396.  
  397. imageSlot8 = SDL_CreateTextureFromSurface(renderer, surface8);
  398.  
  399. SDL_FreeSurface(surface8);
  400.  
  401. imageIndex++;
  402.  
  403. break;
  404. case 9:
  405. imageRect9.x = posX;
  406. imageRect9.y = posY;
  407. imageRect9.w = sizeX;
  408. imageRect9.h = sizeY;
  409.  
  410. SDL_Surface* surface9;
  411.  
  412. surface9 = IMG_Load(path);
  413.  
  414. imageSlot9 = SDL_CreateTextureFromSurface(renderer, surface9);
  415.  
  416. SDL_FreeSurface(surface9);
  417.  
  418. imageIndex++;
  419.  
  420. break;
  421. case 10:
  422. imageRect10.x = posX;
  423. imageRect10.y = posY;
  424. imageRect10.w = sizeX;
  425. imageRect10.h = sizeY;
  426.  
  427. SDL_Surface* surface10;
  428.  
  429. surface10 = IMG_Load(path);
  430.  
  431. imageSlot10 = SDL_CreateTextureFromSurface(renderer, surface10);
  432.  
  433. SDL_FreeSurface(surface10);
  434.  
  435. imageIndex++;
  436.  
  437. break;
  438. }
  439. }
  440.  
  441. void freeImageSlot(int imageSlot)
  442. {
  443. switch(imageSlot)
  444. {
  445. case 1:
  446. SDL_DestroyTexture(imageSlot1);
  447. break;
  448. case 2:
  449. SDL_DestroyTexture(imageSlot2);
  450. break;
  451. case 3:
  452. SDL_DestroyTexture(imageSlot3);
  453. break;
  454. case 4:
  455. SDL_DestroyTexture(imageSlot4);
  456. break;
  457. case 5:
  458. SDL_DestroyTexture(imageSlot5);
  459. break;
  460. case 6:
  461. SDL_DestroyTexture(imageSlot6);
  462. break;
  463. case 7:
  464. SDL_DestroyTexture(imageSlot7);
  465. break;
  466. case 8:
  467. SDL_DestroyTexture(imageSlot8);
  468. break;
  469. case 9:
  470. SDL_DestroyTexture(imageSlot9);
  471. break;
  472. case 10:
  473. SDL_DestroyTexture(imageSlot10);
  474. break;
  475. }
  476. }
  477.  
  478. void createHitbox(int posX, int posY, int width, int height)
  479. {
  480. switch(hitboxIndex)
  481. {
  482. case 1:
  483. hitbox1->x = posX;
  484. hitbox1->y = posY;
  485. hitbox1->w = width;
  486. hitbox1->h = height;
  487.  
  488. break;
  489. case 2:
  490. hitbox2->x = posX;
  491. hitbox2->y = posY;
  492. hitbox2->w = width;
  493. hitbox2->h = height;
  494.  
  495. break;
  496. case 3:
  497. hitbox3->x = posX;
  498. hitbox3->y = posY;
  499. hitbox3->w = width;
  500. hitbox1->h = height;
  501.  
  502. break;
  503. case 4:
  504. hitbox4->x = posX;
  505. hitbox4->y = posY;
  506. hitbox4->w = width;
  507. hitbox4->h = height;
  508.  
  509. break;
  510. case 5:
  511. hitbox5->x = posX;
  512. hitbox5->y = posY;
  513. hitbox5->w = width;
  514. hitbox5->h = height;
  515.  
  516. break;
  517. case 6:
  518. hitbox6->x = posX;
  519. hitbox6->y = posY;
  520. hitbox6->w = width;
  521. hitbox6->h = height;
  522.  
  523. break;
  524. case 7:
  525. hitbox7->x = posX;
  526. hitbox7->y = posY;
  527. hitbox7->w = width;
  528. hitbox7->h = height;
  529.  
  530. break;
  531. case 8:
  532. hitbox8->x = posX;
  533. hitbox8->y = posY;
  534. hitbox8->w = width;
  535. hitbox8->h = height;
  536.  
  537. break;
  538. case 9:
  539. hitbox9->x = posX;
  540. hitbox9->y = posY;
  541. hitbox9->w = width;
  542. hitbox9->h = height;
  543. hitbox9->h = height;
  544.  
  545. break;
  546. case 10:
  547. hitbox10->x = posX;
  548. hitbox10->y = posY;
  549. hitbox10->w = width;
  550. hitbox10->h = height;
  551.  
  552. break;
  553. case 11:
  554. hitbox11->x = posX;
  555. hitbox11->y = posY;
  556. hitbox11->w = width;
  557. hitbox11->h = height;
  558.  
  559. break;
  560. case 12:
  561. hitbox12->x = posX;
  562. hitbox12->y = posY;
  563. hitbox12->w = width;
  564. hitbox12->h = height;
  565.  
  566. break;
  567. case 13:
  568. hitbox13->x = posX;
  569. hitbox13->y = posY;
  570. hitbox13->w = width;
  571. hitbox13->h = height;
  572.  
  573. break;
  574. case 14:
  575. hitbox14->x = posX;
  576. hitbox14->y = posY;
  577. hitbox14->w = width;
  578. hitbox14->h = height;
  579.  
  580. break;
  581. case 15:
  582. hitbox15->x = posX;
  583. hitbox15->y = posY;
  584. hitbox15->w = width;
  585. hitbox15->h = height;
  586.  
  587. break;
  588. case 16:
  589. hitbox16->x = posX;
  590. hitbox16->y = posY;
  591. hitbox16->w = width;
  592. hitbox16->h = height;
  593.  
  594. break;
  595. case 17:
  596. hitbox17->x = posX;
  597. hitbox17->y = posY;
  598. hitbox17->w = width;
  599. hitbox17->h = height;
  600.  
  601. break;
  602. case 18:
  603. hitbox18->x = posX;
  604. hitbox18->y = posY;
  605. hitbox18->w = width;
  606. hitbox18->h = height;
  607.  
  608. break;
  609. case 19:
  610. hitbox19->x = posX;
  611. hitbox19->y = posY;
  612. hitbox19->w = width;
  613. hitbox19->h = height;
  614.  
  615. break;
  616. case 20:
  617. hitbox20->x = posX;
  618. hitbox20->y = posY;
  619. hitbox20->w = width;
  620. hitbox20->h = height;
  621.  
  622. break;
  623. }
  624. }
  625.  
  626. void moveHitbox(SDL_Rect* hitbox, int X, int Y)
  627. {
  628. hitbox->x += X;
  629. hitbox->y += Y;
  630. }
  631.  
  632. int proccessHitboxes()
  633. {
  634. if(SDL_HasIntersection(hitbox1, hitbox2) == true){return 12;}
  635. if(SDL_HasIntersection(hitbox1, hitbox3) == true){return 13;}
  636. if(SDL_HasIntersection(hitbox1, hitbox4) == true){return 14;}
  637. if(SDL_HasIntersection(hitbox1, hitbox5) == true){return 15;}
  638. if(SDL_HasIntersection(hitbox1, hitbox6) == true){return 16;}
  639. if(SDL_HasIntersection(hitbox1, hitbox7) == true){return 17;}
  640. if(SDL_HasIntersection(hitbox1, hitbox8) == true){return 18;}
  641. if(SDL_HasIntersection(hitbox1, hitbox9) == true){return 19;}
  642. if(SDL_HasIntersection(hitbox1, hitbox10) == true){return 110;}
  643. if(SDL_HasIntersection(hitbox1, hitbox11) == true){return 111;}
  644. if(SDL_HasIntersection(hitbox1, hitbox12) == true){return 112;}
  645. if(SDL_HasIntersection(hitbox1, hitbox13) == true){return 113;}
  646. if(SDL_HasIntersection(hitbox1, hitbox14) == true){return 114;}
  647. if(SDL_HasIntersection(hitbox1, hitbox15) == true){return 115;}
  648. if(SDL_HasIntersection(hitbox1, hitbox16) == true){return 116;}
  649. if(SDL_HasIntersection(hitbox1, hitbox17) == true){return 117;}
  650. if(SDL_HasIntersection(hitbox1, hitbox18) == true){return 118;}
  651. if(SDL_HasIntersection(hitbox1, hitbox19) == true){return 119;}
  652. if(SDL_HasIntersection(hitbox1, hitbox20) == true){return 120;}
  653.  
  654. if(SDL_HasIntersection(hitbox2, hitbox3) == true){return 23;}
  655. if(SDL_HasIntersection(hitbox2, hitbox4) == true){return 24;}
  656. if(SDL_HasIntersection(hitbox2, hitbox5) == true){return 25;}
  657. if(SDL_HasIntersection(hitbox2, hitbox6) == true){return 26;}
  658. if(SDL_HasIntersection(hitbox2, hitbox7) == true){return 27;}
  659. if(SDL_HasIntersection(hitbox2, hitbox8) == true){return 28;}
  660. if(SDL_HasIntersection(hitbox2, hitbox9) == true){return 29;}
  661. if(SDL_HasIntersection(hitbox2, hitbox10) == true){return 210;}
  662. if(SDL_HasIntersection(hitbox2, hitbox11) == true){return 211;}
  663. if(SDL_HasIntersection(hitbox2, hitbox12) == true){return 212;}
  664. if(SDL_HasIntersection(hitbox2, hitbox13) == true){return 213;}
  665. if(SDL_HasIntersection(hitbox2, hitbox14) == true){return 214;}
  666. if(SDL_HasIntersection(hitbox2, hitbox15) == true){return 215;}
  667. if(SDL_HasIntersection(hitbox2, hitbox16) == true){return 216;}
  668. if(SDL_HasIntersection(hitbox2, hitbox17) == true){return 217;}
  669. if(SDL_HasIntersection(hitbox2, hitbox18) == true){return 218;}
  670. if(SDL_HasIntersection(hitbox2, hitbox19) == true){return 219;}
  671. if(SDL_HasIntersection(hitbox2, hitbox20) == true){return 220;}
  672.  
  673. if(SDL_HasIntersection(hitbox3, hitbox4) == true){return 34;}
  674. if(SDL_HasIntersection(hitbox3, hitbox5) == true){return 35;}
  675. if(SDL_HasIntersection(hitbox3, hitbox6) == true){return 36;}
  676. if(SDL_HasIntersection(hitbox3, hitbox7) == true){return 37;}
  677. if(SDL_HasIntersection(hitbox3, hitbox8) == true){return 38;}
  678. if(SDL_HasIntersection(hitbox3, hitbox9) == true){return 39;}
  679. if(SDL_HasIntersection(hitbox3, hitbox10) == true){return 310;}
  680. if(SDL_HasIntersection(hitbox3, hitbox11) == true){return 311;}
  681. if(SDL_HasIntersection(hitbox3, hitbox12) == true){return 312;}
  682. if(SDL_HasIntersection(hitbox3, hitbox13) == true){return 313;}
  683. if(SDL_HasIntersection(hitbox3, hitbox14) == true){return 314;}
  684. if(SDL_HasIntersection(hitbox3, hitbox15) == true){return 315;}
  685. if(SDL_HasIntersection(hitbox3, hitbox16) == true){return 316;}
  686. if(SDL_HasIntersection(hitbox3, hitbox17) == true){return 317;}
  687. if(SDL_HasIntersection(hitbox3, hitbox18) == true){return 318;}
  688. if(SDL_HasIntersection(hitbox3, hitbox19) == true){return 319;}
  689. if(SDL_HasIntersection(hitbox3, hitbox20) == true){return 320;}
  690.  
  691. if(SDL_HasIntersection(hitbox4, hitbox5) == true){return 45;}
  692. if(SDL_HasIntersection(hitbox4, hitbox6) == true){return 46;}
  693. if(SDL_HasIntersection(hitbox4, hitbox7) == true){return 47;}
  694. if(SDL_HasIntersection(hitbox4, hitbox8) == true){return 48;}
  695. if(SDL_HasIntersection(hitbox4, hitbox9) == true){return 49;}
  696. if(SDL_HasIntersection(hitbox4, hitbox10) == true){return 410;}
  697. if(SDL_HasIntersection(hitbox4, hitbox11) == true){return 411;}
  698. if(SDL_HasIntersection(hitbox4, hitbox12) == true){return 412;}
  699. if(SDL_HasIntersection(hitbox4, hitbox13) == true){return 413;}
  700. if(SDL_HasIntersection(hitbox4, hitbox14) == true){return 414;}
  701. if(SDL_HasIntersection(hitbox4, hitbox15) == true){return 415;}
  702. if(SDL_HasIntersection(hitbox4, hitbox16) == true){return 416;}
  703. if(SDL_HasIntersection(hitbox4, hitbox17) == true){return 417;}
  704. if(SDL_HasIntersection(hitbox4, hitbox18) == true){return 418;}
  705. if(SDL_HasIntersection(hitbox4, hitbox19) == true){return 419;}
  706. if(SDL_HasIntersection(hitbox4, hitbox20) == true){return 420;}
  707.  
  708. if(SDL_HasIntersection(hitbox5, hitbox6) == true){return 56;}
  709. if(SDL_HasIntersection(hitbox5, hitbox7) == true){return 57;}
  710. if(SDL_HasIntersection(hitbox5, hitbox8) == true){return 58;}
  711. if(SDL_HasIntersection(hitbox5, hitbox9) == true){return 59;}
  712. if(SDL_HasIntersection(hitbox5, hitbox10) == true){return 510;}
  713. if(SDL_HasIntersection(hitbox5, hitbox11) == true){return 511;}
  714. if(SDL_HasIntersection(hitbox5, hitbox12) == true){return 512;}
  715. if(SDL_HasIntersection(hitbox5, hitbox13) == true){return 513;}
  716. if(SDL_HasIntersection(hitbox5, hitbox14) == true){return 514;}
  717. if(SDL_HasIntersection(hitbox5, hitbox15) == true){return 515;}
  718. if(SDL_HasIntersection(hitbox5, hitbox16) == true){return 516;}
  719. if(SDL_HasIntersection(hitbox5, hitbox17) == true){return 517;}
  720. if(SDL_HasIntersection(hitbox5, hitbox18) == true){return 518;}
  721. if(SDL_HasIntersection(hitbox5, hitbox19) == true){return 519;}
  722. if(SDL_HasIntersection(hitbox5, hitbox20) == true){return 520;}
  723.  
  724. if(SDL_HasIntersection(hitbox6, hitbox7) == true){return 67;}
  725. if(SDL_HasIntersection(hitbox6, hitbox8) == true){return 68;}
  726. if(SDL_HasIntersection(hitbox6, hitbox9) == true){return 69;} // NICE
  727. if(SDL_HasIntersection(hitbox6, hitbox10) == true){return 610;}
  728. if(SDL_HasIntersection(hitbox6, hitbox11) == true){return 611;}
  729. if(SDL_HasIntersection(hitbox6, hitbox12) == true){return 612;}
  730. if(SDL_HasIntersection(hitbox6, hitbox13) == true){return 613;}
  731. if(SDL_HasIntersection(hitbox6, hitbox14) == true){return 614;}
  732. if(SDL_HasIntersection(hitbox6, hitbox15) == true){return 615;}
  733. if(SDL_HasIntersection(hitbox6, hitbox16) == true){return 616;}
  734. if(SDL_HasIntersection(hitbox6, hitbox17) == true){return 617;}
  735. if(SDL_HasIntersection(hitbox6, hitbox18) == true){return 618;}
  736. if(SDL_HasIntersection(hitbox6, hitbox19) == true){return 619;}
  737. if(SDL_HasIntersection(hitbox6, hitbox20) == true){return 620;}
  738.  
  739. if(SDL_HasIntersection(hitbox7, hitbox8) == true){return 78;}
  740. if(SDL_HasIntersection(hitbox7, hitbox9) == true){return 79;}
  741. if(SDL_HasIntersection(hitbox7, hitbox10) == true){return 710;}
  742. if(SDL_HasIntersection(hitbox7, hitbox11) == true){return 711;}
  743. if(SDL_HasIntersection(hitbox7, hitbox12) == true){return 712;}
  744. if(SDL_HasIntersection(hitbox7, hitbox13) == true){return 713;}
  745. if(SDL_HasIntersection(hitbox7, hitbox14) == true){return 714;}
  746. if(SDL_HasIntersection(hitbox7, hitbox15) == true){return 715;}
  747. if(SDL_HasIntersection(hitbox7, hitbox16) == true){return 716;}
  748. if(SDL_HasIntersection(hitbox7, hitbox17) == true){return 717;}
  749. if(SDL_HasIntersection(hitbox7, hitbox18) == true){return 718;}
  750. if(SDL_HasIntersection(hitbox7, hitbox19) == true){return 719;}
  751. if(SDL_HasIntersection(hitbox7, hitbox20) == true){return 720;}
  752.  
  753. if(SDL_HasIntersection(hitbox8, hitbox9) == true){return 89;}
  754. if(SDL_HasIntersection(hitbox8, hitbox10) == true){return 810;}
  755. if(SDL_HasIntersection(hitbox8, hitbox11) == true){return 811;}
  756. if(SDL_HasIntersection(hitbox8, hitbox12) == true){return 812;}
  757. if(SDL_HasIntersection(hitbox8, hitbox13) == true){return 813;}
  758. if(SDL_HasIntersection(hitbox8, hitbox14) == true){return 814;}
  759. if(SDL_HasIntersection(hitbox8, hitbox15) == true){return 815;}
  760. if(SDL_HasIntersection(hitbox8, hitbox16) == true){return 816;}
  761. if(SDL_HasIntersection(hitbox8, hitbox17) == true){return 817;}
  762. if(SDL_HasIntersection(hitbox8, hitbox18) == true){return 818;}
  763. if(SDL_HasIntersection(hitbox8, hitbox19) == true){return 819;}
  764. if(SDL_HasIntersection(hitbox8, hitbox20) == true){return 820;}
  765.  
  766. if(SDL_HasIntersection(hitbox9, hitbox10) == true){return 910;}
  767. if(SDL_HasIntersection(hitbox9, hitbox11) == true){return 911;}
  768. if(SDL_HasIntersection(hitbox9, hitbox12) == true){return 912;}
  769. if(SDL_HasIntersection(hitbox9, hitbox13) == true){return 913;}
  770. if(SDL_HasIntersection(hitbox9, hitbox14) == true){return 914;}
  771. if(SDL_HasIntersection(hitbox9, hitbox15) == true){return 915;}
  772. if(SDL_HasIntersection(hitbox9, hitbox16) == true){return 916;}
  773. if(SDL_HasIntersection(hitbox9, hitbox17) == true){return 917;}
  774. if(SDL_HasIntersection(hitbox9, hitbox18) == true){return 918;}
  775. if(SDL_HasIntersection(hitbox9, hitbox19) == true){return 919;}
  776. if(SDL_HasIntersection(hitbox9, hitbox20) == true){return 920;}
  777.  
  778. if(SDL_HasIntersection(hitbox10, hitbox11) == true){return 1011;}
  779. if(SDL_HasIntersection(hitbox10, hitbox12) == true){return 1012;}
  780. if(SDL_HasIntersection(hitbox10, hitbox13) == true){return 1013;}
  781. if(SDL_HasIntersection(hitbox10, hitbox14) == true){return 1014;}
  782. if(SDL_HasIntersection(hitbox10, hitbox15) == true){return 1015;}
  783. if(SDL_HasIntersection(hitbox10, hitbox16) == true){return 1016;}
  784. if(SDL_HasIntersection(hitbox10, hitbox17) == true){return 1017;}
  785. if(SDL_HasIntersection(hitbox10, hitbox18) == true){return 1018;}
  786. if(SDL_HasIntersection(hitbox10, hitbox19) == true){return 1019;}
  787. if(SDL_HasIntersection(hitbox10, hitbox20) == true){return 1020;}
  788.  
  789. if(SDL_HasIntersection(hitbox11, hitbox12) == true){return 1112;}
  790. if(SDL_HasIntersection(hitbox11, hitbox13) == true){return 1113;}
  791. if(SDL_HasIntersection(hitbox11, hitbox14) == true){return 1114;}
  792. if(SDL_HasIntersection(hitbox11, hitbox15) == true){return 1115;}
  793. if(SDL_HasIntersection(hitbox11, hitbox16) == true){return 1116;}
  794. if(SDL_HasIntersection(hitbox11, hitbox17) == true){return 1117;}
  795. if(SDL_HasIntersection(hitbox11, hitbox18) == true){return 1118;}
  796. if(SDL_HasIntersection(hitbox11, hitbox19) == true){return 1119;}
  797. if(SDL_HasIntersection(hitbox11, hitbox20) == true){return 1120;}
  798.  
  799. if(SDL_HasIntersection(hitbox12, hitbox13) == true){return 1213;}
  800. if(SDL_HasIntersection(hitbox12, hitbox14) == true){return 1214;}
  801. if(SDL_HasIntersection(hitbox12, hitbox15) == true){return 1215;}
  802. if(SDL_HasIntersection(hitbox12, hitbox16) == true){return 1216;}
  803. if(SDL_HasIntersection(hitbox12, hitbox17) == true){return 1217;}
  804. if(SDL_HasIntersection(hitbox12, hitbox18) == true){return 1218;}
  805. if(SDL_HasIntersection(hitbox12, hitbox19) == true){return 1219;}
  806. if(SDL_HasIntersection(hitbox12, hitbox20) == true){return 1220;}
  807.  
  808. if(SDL_HasIntersection(hitbox13, hitbox14) == true){return 1314;}
  809. if(SDL_HasIntersection(hitbox13, hitbox15) == true){return 1315;}
  810. if(SDL_HasIntersection(hitbox13, hitbox16) == true){return 1316;}
  811. if(SDL_HasIntersection(hitbox13, hitbox17) == true){return 1317;}
  812. if(SDL_HasIntersection(hitbox13, hitbox18) == true){return 1318;}
  813. if(SDL_HasIntersection(hitbox13, hitbox19) == true){return 1319;}
  814. if(SDL_HasIntersection(hitbox13, hitbox20) == true){return 1320;}
  815.  
  816. if(SDL_HasIntersection(hitbox14, hitbox15) == true){return 1415;}
  817. if(SDL_HasIntersection(hitbox14, hitbox16) == true){return 1416;}
  818. if(SDL_HasIntersection(hitbox14, hitbox17) == true){return 1417;}
  819. if(SDL_HasIntersection(hitbox14, hitbox18) == true){return 1418;}
  820. if(SDL_HasIntersection(hitbox14, hitbox19) == true){return 1419;}
  821. if(SDL_HasIntersection(hitbox14, hitbox20) == true){return 1420;}
  822.  
  823. if(SDL_HasIntersection(hitbox15, hitbox16) == true){return 1516;}
  824. if(SDL_HasIntersection(hitbox15, hitbox17) == true){return 1517;}
  825. if(SDL_HasIntersection(hitbox15, hitbox18) == true){return 1518;}
  826. if(SDL_HasIntersection(hitbox15, hitbox19) == true){return 1519;}
  827. if(SDL_HasIntersection(hitbox15, hitbox20) == true){return 1520;}
  828.  
  829. if(SDL_HasIntersection(hitbox16, hitbox17) == true){return 1617;}
  830. if(SDL_HasIntersection(hitbox16, hitbox17) == true){return 1618;}
  831. if(SDL_HasIntersection(hitbox16, hitbox17) == true){return 1619;}
  832. if(SDL_HasIntersection(hitbox16, hitbox17) == true){return 1620;}
  833.  
  834. if(SDL_HasIntersection(hitbox17, hitbox18) == true){return 1718;}
  835. if(SDL_HasIntersection(hitbox17, hitbox19) == true){return 1719;}
  836. if(SDL_HasIntersection(hitbox17, hitbox20) == true){return 1720;}
  837.  
  838. if(SDL_HasIntersection(hitbox18, hitbox19) == true){return 1819;}
  839. if(SDL_HasIntersection(hitbox18, hitbox20) == true){return 1820;}
  840.  
  841. if(SDL_HasIntersection(hitbox19, hitbox20) == true){return 1920;}
  842. }
  843.  
  844. void clearScene()
  845. {
  846. imageIndex = 1;
  847.  
  848. freeImageSlot(1);
  849. freeImageSlot(2);
  850. freeImageSlot(3);
  851. freeImageSlot(4);
  852. freeImageSlot(5);
  853. freeImageSlot(6);
  854. freeImageSlot(7);
  855. freeImageSlot(8);
  856. freeImageSlot(9);
  857. freeImageSlot(10);
  858.  
  859. deleteButtons();
  860. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement