Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 114.93 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6. #include "iGraphics.h"
  7. #include <time.h>
  8. #include<cstdio>
  9.  
  10.  
  11. using namespace std;
  12.  
  13.  
  14. time_t t;
  15.  
  16.  
  17. int score_direction = 1;
  18. int dsd = 2;
  19. double hs_y = 128;
  20.  
  21.  
  22. int cell_damage = 100;
  23. int go = 0;
  24. int res = 1;
  25.  
  26. int obscr;
  27. int obscr1;
  28. int obscr2;
  29.  
  30. int damage = 1000;
  31. int frieza_life = 3000;
  32. double red;
  33. double green;
  34.  
  35.  
  36. int c = 0;
  37. int g = 0;
  38. int s = 0;
  39.  
  40.  
  41. int super = 1;
  42. int score = 0;
  43.  
  44. int run = 0;
  45. int goku_x = 200;
  46. int run_y = 140;
  47. int run_co = 0;
  48. int gr = 0;
  49. int gr1 = 0;
  50. int gr2 = 0;
  51. int gr3 = 0;
  52. int gr4 = 0;
  53. int gr5 = 0;
  54. int gr6 = 0;
  55. int gr7 = 0;
  56. int gr8 = 0;
  57. int gr9 = 0;
  58.  
  59. int blast_co = 0;
  60. int blast_speed = 25;
  61.  
  62. int blast = 0;
  63. int blast_x = 240;
  64. int blast_y;
  65. int blast_button = 0;
  66. int blast_flag = 0;
  67.  
  68. int blast1 = 0;
  69. int blast1_x = 240;
  70. int blast1_y;
  71. int blast1_button = 0;
  72. int blast1_flag = 0;
  73.  
  74. int blast2 = 0;
  75. int blast2_x = 240;
  76. int blast2_y;
  77. int blast2_button = 0;
  78. int blast2_flag = 0;
  79.  
  80. int blast3 = 0;
  81. int blast3_x = 240;
  82. int blast3_y;
  83. int blast3_button = 0;
  84. int blast3_flag = 0;
  85.  
  86. int blast4 = 0;
  87. int blast4_x = 240;
  88. int blast4_y;
  89. int blast4_button = 0;
  90. int blast4_flag = 0;
  91.  
  92. int blast5 = 0;
  93. int blast5_x = 240;
  94. int blast5_y;
  95. int blast5_button = 0;
  96. int blast5_flag = 0;
  97.  
  98. int blast6 = 0;
  99. int blast6_x = 240;
  100. int blast6_y;
  101. int blast6_button = 0;
  102. int blast6_flag = 0;
  103.  
  104. int blast7 = 0;
  105. int blast7_x = 240;
  106. int blast7_y;
  107. int blast7_button = 0;
  108. int blast7_flag = 0;
  109.  
  110. int blast8 = 0;
  111. int blast8_x = 240;
  112. int blast8_y;
  113. int blast8_button = 0;
  114. int blast8_flag = 0;
  115.  
  116. int blast9 = 0;
  117. int blast9_x = 240;
  118. int blast9_y;
  119. int blast9_button = 0;
  120. int blast9_flag = 0;
  121.  
  122.  
  123. int jump_key = 0;
  124. int jump = 0;
  125. int jump_x = 240;
  126. int jump_y = 140;
  127. int jump_h1 = 150;
  128. int jump_h2 = 260;
  129. int jump_limit = 450;
  130. int jd = 25;
  131. int jump_dif = jd;
  132. int jump_co = 0;
  133.  
  134.  
  135. int ground_y = 0;
  136. int ground_x = 128;
  137. int ground_x1 = 256;
  138. int ground_x2 = 384;
  139. int ground_x3 = 512;
  140. int ground_x4 = 640;
  141. int ground_x5 = 768;
  142. int ground_x6 = 896;
  143. int ground_x7 = 1024;
  144. int ground_x8 = 1152;
  145. int ground_x9 = 1280;
  146. int ground_x10 = 1408;
  147.  
  148.  
  149. int gdx = 8;
  150. int cloud_position_x = 500;
  151. int cloud_position_y = 520;
  152. int cloud2_position_x = 900;
  153. int cloud2_position_y = 620;
  154. int cloud1_position_x = 2350;
  155. int cloud1_position_y = 670;
  156. int jumping = 0;
  157.  
  158.  
  159. int spike_x = 1700;
  160. int spike2_x = 2300;
  161. int spike3_x = 2600;
  162. int spike34_diff = 400;
  163. int spike4_x = 3000;
  164. int spike5_x = 2600;
  165. int spike56_diff = 800;
  166. int spike6_x = 3400;
  167. int spike7_x = 2600;
  168. int spike78_diff = 134;
  169. int spike8_x = 2728;
  170. int spike9_x = 2600;
  171. int spike910_diff = 128;
  172. int spike10_x = 2728;
  173. int spike1011_diff = 600;
  174. int spike11_x = 3128;
  175. int spike_y = 140;
  176. int spike_direction = 1;
  177. int random;
  178. int spike_limit = 300;
  179. int spike_difference = 40;
  180. int spike_speed = 8;
  181. int spk_dmg = 5;
  182.  
  183. int sani_co = 0;
  184. char sup_str[] = "SS1.bmp";
  185. int s_anim = 0;
  186. int sco = 0;
  187.  
  188. int st_sc = 0;
  189. int press_co = 0;
  190. char pr_str[] = "N1.bmp";
  191. int prc = 0;
  192. int pri = 0;
  193.  
  194. int S_co = 0;
  195. char S_str[] = "S1.bmp";
  196. int Sc = 0;
  197. int Si = 0;
  198.  
  199. int I_co = 0;
  200. char I_str[] = "I1.bmp";
  201. int Ic = 0;
  202. int Ii = 0;
  203.  
  204. int H_co = 0;
  205. char H_str[] = "H1.bmp";
  206. int Hc = 0;
  207. int Hi = 0;
  208.  
  209. int Q_co = 0;
  210. char Q_str[] = "Q1.bmp";
  211. int Qc = 0;
  212. int Qi = 0;
  213.  
  214. int gol_anim = 0;
  215. int gol_c = 0;
  216. int gco = 0;
  217. char gol_str[] = "GT1.bmp";
  218.  
  219. int sp_sc = 0;
  220.  
  221. int aust_co = 0;
  222. int aco = 0;
  223. char au_str[] = "aust1.bmp";
  224. int aust_po = 0;
  225. int aub = 0;
  226.  
  227. int niloy_co = 0;
  228. int nco = 0;
  229. char ni_str[] = "niloy1.bmp";
  230. int niloy_po = 0;
  231. int nib = 0;
  232.  
  233. int tokey_co = 0;
  234. int tco = 0;
  235. char to_str[] = "tokey1.bmp";
  236. int tokey_po = 0;
  237. int tob = 0;
  238.  
  239. int go_co = 0;
  240. char go_str[] = "go1.bmp";
  241. int g_co = 0;
  242.  
  243. int spikehit = 0;
  244. int spikehit2 = 0;
  245. int spikehit3 = 0;
  246. int spikehit4 = 0;
  247. int spikehit5 = 0;
  248. int spikehit6 = 0;
  249. int spikehit7 = 0;
  250. int spikehit8 = 0;
  251. int spikehit9 = 0;
  252. int spikehit10 = 0;
  253. int spikehit11 = 0;
  254.  
  255. int obs_bl = 0;
  256. int obm_bl = 0;
  257. int obl_bl = 0;
  258.  
  259. int pause_state = 0;
  260. char pause_str[] = "resume1.bmp";
  261. int p_co = 0;
  262. int pauseC = 0;
  263. int pause_co = 0;
  264. int pi = 0;
  265.  
  266. char ret_str[] = "ret1.bmp";
  267. int r_co = 0;
  268. int retC = 0;
  269. int ret_co = 0;
  270. int ri = 0;
  271.  
  272. int yes_st = 0;
  273. char yes_str[] = "yes1.bmp";
  274. int y_co = 0;
  275. int yesC = 0;
  276. int yes_co = 0;
  277. int yi = 0;
  278.  
  279. char no_str[] = "no1.bmp";
  280. int n_co = 0;
  281. int noC = 0;
  282. int no_co = 0;
  283. int ni = 0;
  284.  
  285. int load_st = 0;
  286. double load_bar = 0;
  287. char lo_str[] = "lo1.bmp";
  288. int lo_co = 0;
  289. int lco = 0;
  290. int lo_po = 0;
  291.  
  292.  
  293.  
  294. int story_st = 0;
  295.  
  296. char frs_str[] = "frs1.bmp";
  297. int frs_co = 0;
  298. int frco = 0;
  299. int fri = 0;
  300.  
  301. char sec_str[] = "sec1.bmp";
  302. int sec_co = 0;
  303. int seco = 0;
  304. int sei = 0;
  305.  
  306. char thr_str[] = "thr1.bmp";
  307. int thr_co = 0;
  308. int thco = 0;
  309. int thi = 0;
  310.  
  311. char for_str[] = "for1.bmp";
  312. int for_co = 0;
  313. int foco = 0;
  314. int foi = 0;
  315.  
  316. char fif_str[] = "fif1.bmp";
  317. int fif_co = 0;
  318. int fico = 0;
  319. int fii = 0;
  320.  
  321. char six_str[] = "six1.bmp";
  322. int six_co = 0;
  323. int sico = 0;
  324. int sii = 0;
  325.  
  326. char sev_str[] = "sev1.bmp";
  327. int sev_co = 0;
  328. int svco = 0;
  329. int svi = 0;
  330.  
  331. int frb = 0;
  332. int seb = 0;
  333. int thb = 0;
  334. int fob = 0;
  335. int fib = 0;
  336. int sib = 0;
  337. int svb = 0;
  338.  
  339. int con_co = 0;
  340. int conC = 0;
  341. int con_po = 0;
  342. char con_str[] = "cont1.bmp";
  343.  
  344. int ski_co = 0;
  345. int skiC = 0;
  346. int ski_po = 0;
  347. char ski_str[] = "skip1.bmp";
  348.  
  349. int ins_st = 0;
  350. int ins_co = 0;
  351. int inco = 0;
  352. char in_str[] = "ins1.bmp";
  353. int in_po = 0;
  354.  
  355. int hs_st = 0;
  356. int hs_co = 0;
  357. int hco = 0;
  358. char hs_str[] = "popo1.bmp";
  359. int hs_po = 0;
  360.  
  361. int hsc_st = 0;
  362. int hsc_co = 0;
  363. int hsco = 0;
  364. char hsc_str[] = "hs1.bmp";
  365. int hs_x = 0;
  366. int hs_d = 0;
  367.  
  368. FILE *fp;
  369. FILE *fw;
  370. char name[100][100];
  371. int fscore[100];
  372. int fr_st = 0;
  373.  
  374. int sco_st = 0;
  375. int sco_co = 0;
  376. int scoC = 0;
  377. char sco_str[] = "scorepl1.bmp";
  378. int sco_po = 0;
  379.  
  380. int scor_co = 0;
  381. int scorC = 0;
  382. char scor_str[] = "scorert1.bmp";
  383. int scor_po = 0;
  384.  
  385. int nhs_co = 0;
  386. int nhsC = 0;
  387. char nhs_str[] = "nhs1.bmp";
  388. char string[1000];
  389. int mode = 0;
  390. int len = 0;
  391. int line = 10;
  392.  
  393.  
  394. char strn2[100][100];
  395. double fred = 0;
  396. double fgreen = 0;
  397.  
  398. void read()
  399. {
  400. fp = fopen("Highscore.txt", "r");
  401. int i;
  402. for (i = 0; i < 7; i++)
  403. {
  404. fscanf(fp, "%s %d", name[i], &fscore[i]);
  405. }
  406. fcloseall();
  407. }
  408. void write()
  409. {
  410. read();
  411. if (fscore[6] < score)
  412. {
  413. fscore[7] = score;
  414. mode = 1;
  415. }
  416. }
  417. void sortit()
  418. {
  419. int i, j, t;
  420. char str[1000];
  421.  
  422. fp = fopen("Highscore.txt", "r");
  423. for (i = 0; i < 7; i++)
  424. {
  425. fscanf(fp, "%s %d", strn2[i], &t);
  426. }
  427. fcloseall();
  428. //Bubble Sort :3
  429. for (i = 0; i <= 7; i++){
  430. for (j = i + 1; j <= 7; j++)
  431. {
  432. if (fscore[i] < fscore[j])
  433. {
  434. t = fscore[i];
  435. fscore[i] = fscore[j];
  436. fscore[j] = t;
  437.  
  438. strcpy(str, name[i]);
  439. strcpy(name[i], name[j]);
  440. strcpy(name[j], str);
  441.  
  442. }
  443. }
  444. }
  445. fw = fopen("Highscore.txt", "w");
  446. for (i = 0; i < 7; i++)
  447. {
  448. fprintf(fw, "%s\t%d\n", name[i], fscore[i]);
  449. }
  450. fcloseall();
  451.  
  452. }
  453. void find()
  454. {
  455. if (!(strcmp(name[0], strn2[0]) == 0))
  456. line = 0;
  457. else if (!(strcmp(name[1], strn2[1]) == 0))
  458. line = 1;
  459. else if (!(strcmp(name[2], strn2[2]) == 0))
  460. line = 2;
  461. else if (!(strcmp(name[3], strn2[3]) == 0))
  462. line = 3;
  463. else if (!(strcmp(name[4], strn2[4]) == 0))
  464. line = 4;
  465. else if (!(strcmp(name[5], strn2[5]) == 0))
  466. line = 5;
  467. else if (!(strcmp(name[6], strn2[6]) == 0))
  468. line = 6;
  469.  
  470. }
  471. void groundMovement() {
  472. ground_x -= gdx;
  473. ground_x1 -= gdx;
  474. ground_x2 -= gdx;
  475. ground_x3 -= gdx;
  476. ground_x4 -= gdx;
  477. ground_x5 -= gdx;
  478. ground_x6 -= gdx;
  479. ground_x7 -= gdx;
  480. ground_x8 -= gdx;
  481. ground_x9 -= gdx;
  482. ground_x10 -= gdx;
  483. if (ground_x < 0) {
  484. ground_x = 1273;
  485. }
  486. if (ground_x1 < 0) {
  487. ground_x1 = 1273;
  488. }
  489. if (ground_x2 < 0) {
  490. ground_x2 = 1273;
  491. }
  492. if (ground_x3 < 0) {
  493. ground_x3 = 1273;
  494. }
  495. if (ground_x4 <0) {
  496. ground_x4 = 1273;
  497. }
  498. if (ground_x5 < 0) {
  499. ground_x5 = 1273;
  500. }
  501. if (ground_x6 < 0) {
  502. ground_x6 = 1273;
  503. }
  504. if (ground_x7 < 0) {
  505. ground_x7 = 1273;
  506. }
  507. if (ground_x8 < 0) {
  508. ground_x8 = 1273;
  509. }
  510. if (ground_x9 < 0) {
  511. ground_x9 = 1273;
  512. }
  513. if (ground_x10 < 0) {
  514. ground_x10 = 1273;
  515. }
  516. }
  517. void goku_run() {
  518. if (pause_state == 0 && !(sp_sc >= 0 && sp_sc <= 2) && !(st_sc >= 0 && st_sc <= 4) && go == 0)
  519. {
  520. run++;
  521. if (run >= 8)
  522. run = 0;
  523. }
  524. }
  525.  
  526. //jump
  527. void goku_jump() {
  528. if (pause_state == 0 && !(sp_sc >= 0 && sp_sc <= 2) && !(st_sc >= 0 && st_sc <= 4) && go == 0){
  529. if (jumping == 1){
  530. jump_dif--;
  531.  
  532. jump_y += jump_dif;
  533. if (jump_dif < 0)
  534. jumping = 2;
  535. if (jump_y == run_y) {
  536. jump = 0;
  537. }
  538. else if (jump_y <= jump_h2) {
  539. jump = 1;
  540. }
  541. else if (jump_y < jump_limit) {
  542. jump = 2;
  543. }
  544. }
  545. else if (jumping == 2) {
  546. jump_dif--;
  547. jump_y += jump_dif;
  548. if (jump_y >= jump_h1) {
  549. jump = 0;
  550. }
  551. else if (jump_y >= jump_h2) {
  552. jump = 1;
  553. }
  554. else if (jump_y > run_y) {
  555. jump = 2;
  556. }
  557. if (jump_y <= 140)
  558. {
  559. jumping = 0;
  560. jump_co = 0;
  561. jump_limit = 450;
  562. jump_dif = jd;
  563. jump_y = 140;
  564. }
  565. }
  566. }
  567. }
  568. void goku_blast(){
  569. if (pause_state == 0 && !(sp_sc >= 0 && sp_sc <= 2) && !(st_sc >= 0 && st_sc <= 4) && go == 0){
  570. if (blast_button != 0)
  571. {
  572. blast++;
  573. if (blast > 5)
  574. blast_x += blast_speed;
  575.  
  576. if (blast >= 200)
  577. blast = 0;
  578. }
  579. else{
  580. blast = 0;
  581. }
  582. if (blast1_button != 0)
  583. {
  584. blast1++;
  585. if (blast1 > 5)
  586. blast1_x += blast_speed;
  587.  
  588. if (blast1 >= 200)
  589. blast1 = 0;
  590. }
  591. else{
  592. blast1 = 0;
  593. }
  594. if (blast2_button != 0)
  595. {
  596. blast2++;
  597. if (blast2 > 5)
  598. blast2_x += blast_speed;
  599. if (blast2 >= 200)
  600. blast2 = 0;
  601. }
  602. else{
  603. blast2 = 0;
  604. }
  605.  
  606. if (blast3_button != 0)
  607. {
  608. blast3++;
  609. if (blast3 > 5)
  610. blast3_x += blast_speed;
  611. if (blast3 >= 200)
  612. blast3 = 0;
  613. }
  614. else{
  615. blast3 = 0;
  616. }
  617.  
  618. if (blast4_button != 0)
  619. {
  620. blast4++;
  621. if (blast4 > 5)
  622. blast4_x += blast_speed;
  623. if (blast4 >= 200)
  624. blast4 = 0;
  625. }
  626. else{
  627. blast4 = 0;
  628. }
  629.  
  630. if (blast5_button != 0)
  631. {
  632. blast5++;
  633. if (blast5 > 5)
  634. blast5_x += blast_speed;
  635. if (blast5 >= 200)
  636. blast5 = 0;
  637. }
  638. else{
  639. blast5 = 0;
  640. }
  641. if (blast6_button != 0)
  642. {
  643. blast6++;
  644. if (blast6 > 5)
  645. blast6_x += blast_speed;
  646. if (blast6 >= 200)
  647. blast6 = 0;
  648. }
  649. else{
  650. blast6 = 0;
  651. }
  652. if (blast7_button != 0)
  653. {
  654. blast7++;
  655. if (blast7 > 5)
  656. blast7_x += blast_speed;
  657. if (blast7 >= 200)
  658. blast7 = 0;
  659. }
  660. else{
  661. blast7 = 0;
  662. }
  663. if (blast8_button != 0)
  664. {
  665. blast8++;
  666. if (blast8 > 5)
  667. blast8_x += blast_speed;
  668. if (blast8 >= 200)
  669. blast8 = 0;
  670. }
  671. else{
  672. blast8 = 0;
  673. }
  674. if (blast9_button != 0)
  675. {
  676. blast9++;
  677. if (blast9 > 5)
  678. blast9_x += blast_speed;
  679. if (blast9 >= 200)
  680. blast9 = 0;
  681. }
  682. else{
  683. blast9 = 0;
  684. }
  685. }
  686. }
  687.  
  688.  
  689. void spike_move() {
  690. if (random == 1) {
  691. spike_direction = 1;
  692. }
  693. else if (random == 2) {
  694. spike_direction = 2;
  695. }
  696. else if (random == 3) {
  697. spike_direction = 3;
  698. }
  699. else if (random == 4) {
  700. spike_direction = 4;
  701. }
  702. else if (random == 5) {
  703. spike_direction = 5;
  704. }
  705. else if (random == 6) {
  706. spike_direction = 6;
  707. }
  708. if (spike_direction == 1) {
  709. spike_x -= spike_speed;
  710. if (spike_x <= 0) {
  711. spikehit = 0;
  712. spike_x = 1300;
  713. random = rand() % 7;
  714. }
  715. }
  716. else if (spike_direction == 2) {
  717. spike2_x -= spike_speed;
  718. if (spike2_x <= 0) {
  719. spikehit2 = 0;
  720. spike2_x = 1350;
  721. random = rand() % 7;
  722.  
  723. }
  724. }
  725. else if (spike_direction == 3) {
  726.  
  727. spike3_x -= spike_speed;
  728. spike4_x -= spike_speed;
  729. if (spike4_x <= 0) {
  730. spikehit3 = 0;
  731. spikehit4 = 0;
  732. spike3_x = 1300;
  733. spike4_x = spike3_x + spike34_diff;
  734. random = rand() % 7;
  735.  
  736. }
  737. }
  738. else if (spike_direction == 4) {
  739. spike5_x -= spike_speed;
  740. spike6_x -= spike_speed;
  741. if (spike6_x <= 0) {
  742. spikehit5 = 0;
  743. spikehit6 = 0;
  744. spike5_x = 1300;
  745. spike6_x = spike3_x + spike56_diff;
  746. random = rand() % 7;
  747.  
  748. }
  749. }
  750. else if (spike_direction == 5) {
  751. spike7_x -= spike_speed;
  752. spike8_x -= spike_speed;
  753. if (spike8_x <= 0) {
  754. spikehit7 = 0;
  755. spikehit8 = 0;
  756. spike7_x = 1300;
  757. spike8_x = spike7_x + spike78_diff;
  758. random = rand() % 7;
  759.  
  760. }
  761. }
  762. else if (spike_direction == 6) {
  763. spike9_x -= spike_speed;
  764. spike10_x -= spike_speed;
  765. spike11_x -= spike_speed;
  766. if (spike11_x <= 0) {
  767. spikehit9 = 0;
  768.  
  769. spikehit10 = 0;
  770.  
  771. spikehit11 = 0;
  772.  
  773. spike9_x = 1300;
  774. spike10_x = spike9_x + spike910_diff;
  775. spike11_x = spike10_x + spike1011_diff;
  776. random = rand() % 7;
  777.  
  778. }
  779. }
  780. }
  781.  
  782.  
  783. //Spike goku hit
  784.  
  785. void spike_hit() {
  786. if (goku_x >= spike_x - 40 && goku_x <= spike_x + 128 && jump_y <= 160) {
  787. spikehit = 1;
  788. damage -= spk_dmg;
  789. }
  790. if (goku_x >= spike2_x - 40 && goku_x <= spike2_x + 128 && jump_y <= 160) {
  791. spikehit2 = 1;
  792. damage -= spk_dmg;
  793. }
  794. if (goku_x >= spike3_x - 40 && goku_x <= spike3_x + 128 && jump_y <= 160) {
  795. spikehit3 = 1;
  796. damage -= spk_dmg;
  797. }
  798. if (goku_x >= spike4_x - 40 && goku_x <= spike4_x + 128 && jump_y <= 160) {
  799. spikehit4 = 1;
  800. damage -= spk_dmg;
  801. }
  802. if (goku_x >= spike5_x - 40 && goku_x <= spike5_x + 128 && jump_y <= 160) {
  803. spikehit5 = 1;
  804. damage -= spk_dmg;
  805. }
  806. if (goku_x >= spike6_x - 40 && goku_x <= spike6_x + 128 && jump_y <= 160) {
  807. spikehit6 = 1;
  808. damage -= spk_dmg;
  809. }
  810. if (goku_x >= spike7_x - 40 && goku_x <= spike7_x + 128 && jump_y <= 160) {
  811. spikehit7 = 1;
  812. damage -= spk_dmg;
  813. }
  814. if (goku_x >= spike8_x - 40 && goku_x <= spike8_x + 128 && jump_y <= 160) {
  815. spikehit8 = 1;
  816. damage -= spk_dmg;
  817. }
  818.  
  819. if (goku_x >= spike9_x - 40 && goku_x <= spike9_x + 128 && jump_y <= 160) {
  820. spikehit9 = 1;
  821. damage -= 10;
  822. }
  823.  
  824. if (goku_x >= spike10_x - 40 && goku_x <= spike10_x + 128 && jump_y <= 160) {
  825. spikehit10 = 1;
  826. damage -= 10;
  827. }
  828. if (goku_x >= spike11_x - 40 && goku_x <= spike11_x + 128 && jump_y <= 160) {
  829. spikehit11 = 1;
  830. damage -= 10;
  831. }
  832. }
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839. //cell
  840.  
  841. int cell_x = 1600;
  842. int cell_y = 300;
  843. int cell1_y = 300;
  844. int cell2_y = 525;
  845. int cell3_y = 600;
  846.  
  847.  
  848. int cell_speed = 20;
  849. int random_cell;
  850.  
  851. int cell = 0;
  852. void cell_move() {
  853. cell_x -= cell_speed;
  854. if (cell_x <= 0) {
  855. cell_x = 1300;
  856. random_cell = rand() % 4;
  857. }
  858. else if (cell == 1) {
  859. cell_x = 1450;
  860. random_cell = rand() % 4;
  861. }
  862. if (random_cell == 1) {
  863. cell_y = cell1_y;
  864. }
  865. else if (random_cell == 2) {
  866. cell_y = cell2_y;
  867.  
  868. }
  869. else if (random_cell == 3) {
  870. cell_y = cell3_y;
  871.  
  872. }
  873. }
  874.  
  875. int random2_cell;
  876. int cell10_x = 10000;
  877. int cell10_y = 225;
  878. int cell11_y = 225;
  879. int cell12_y = 450;
  880. int cell13_y = 675;
  881. int cell_diff1 = 6;
  882. int cell1 = 0;
  883. void cell_move2() {
  884. cell10_x -= cell_speed + cell_diff1;
  885. if (cell10_x <= 0) {
  886. cell10_x = 1300;
  887. random2_cell = rand() % 4;
  888. }
  889. else if (cell1 == 1) {
  890. cell10_x = 1400;
  891. random2_cell = rand() % 4;
  892. }
  893. if (random2_cell == 1) {
  894. cell10_y = cell11_y;
  895. }
  896. else if (random2_cell == 2) {
  897. cell10_y = cell12_y;
  898. }
  899. else if (random2_cell == 3) {
  900. cell10_y = cell13_y;
  901. }
  902.  
  903. }
  904. int random3_cell;
  905. int cell20_x = 20000;
  906. int cell20_y = 150;
  907. int cell21_y = 150;
  908. int cell22_y = 375;
  909.  
  910. int cell23_y = 200;
  911. int cell_diff2 = 10;
  912.  
  913. int cell2 = 0;
  914. void cell_move3() {
  915. cell20_x -= (cell_speed + cell_diff2);
  916. if (cell20_x <= 0) {
  917. random3_cell = rand() % 4;
  918. cell20_x = 1350;
  919. }
  920. else if (cell2 == 1) {
  921.  
  922. cell20_x = 1450;
  923. random3_cell = rand() % 4;
  924.  
  925. }
  926. if (random3_cell == 1) {
  927. cell20_y = cell21_y;
  928. }
  929. else if (random3_cell == 2) {
  930. cell20_y = cell22_y;
  931. }
  932. else if (random3_cell == 3) {
  933. cell20_y = cell23_y;
  934. }
  935. }
  936.  
  937. int hit = 0;
  938. int ss = 5;
  939.  
  940. void cell_hit() {
  941. if ((blast_x >= cell_x - 10) && (blast_y >= cell_y && blast_y <= cell_y + 80)) {
  942. cell = 1;
  943.  
  944. hit = 1;
  945. score += ss;
  946. blast_x = 1300;
  947. }
  948. else if ((blast1_x >= cell_x - 10) && (blast1_y >= cell_y - 10 && blast1_y <= cell_y + 80)) {
  949. cell = 1;
  950.  
  951. hit = 1;
  952. score += ss;
  953. blast1_x = 1300;
  954.  
  955. }
  956. else if ((blast2_x >= cell_x - 10) && (blast2_y >= cell_y - 10 && blast2_y <= cell_y + 80)) {
  957. cell = 1;
  958.  
  959. hit = 1;
  960. score += ss;
  961. blast2_x = 1300;
  962. }
  963. else if ((blast3_x >= cell_x - 10) && (blast3_y >= cell_y - 10 && blast3_y <= cell_y + 80)) {
  964. cell = 1;
  965.  
  966. hit = 1;
  967. score += ss;
  968. blast3_x = 1300;
  969. }
  970. else if ((blast4_x >= cell_x - 10) && (blast4_y >= cell_y - 10 && blast4_y <= cell_y + 80)) {
  971. cell = 1;
  972.  
  973. hit = 1;
  974. score += ss;
  975. blast4_x = 1300;
  976. }
  977. else if ((blast5_x >= cell_x - 10) && (blast5_y >= cell_y - 10 && blast5_y <= cell_y + 80)) {
  978. cell = 1;
  979.  
  980. hit = 1;
  981. score += ss;
  982. blast5_x = 1300;
  983. }
  984. else if ((blast6_x >= cell_x - 10) && (blast6_y >= cell_y - 10 && blast6_y <= cell_y + 80)) {
  985. cell = 1;
  986.  
  987. hit = 1;
  988. score += ss;
  989. blast6_x = 1300;
  990. }
  991. else if ((blast7_x >= cell_x - 10) && (blast7_y >= cell_y - 10 && blast7_y <= cell_y + 80)) {
  992. cell = 1;
  993.  
  994. hit = 1;
  995. score += ss;
  996. blast7_x = 1300;
  997. }
  998. else if ((blast8_x >= cell_x - 10) && (blast8_y >= cell_y - 10 && blast8_y <= cell_y + 80)) {
  999. cell = 1;
  1000. hit = 1;
  1001. score += ss;
  1002. blast8_x = 1300;
  1003. }
  1004. else if ((blast9_x >= cell_x - 10) && (blast9_y >= cell_y - 10 && blast9_y <= cell_y + 80)) {
  1005. cell = 1;
  1006. hit = 1;
  1007. score += ss;
  1008. blast9_x = 1300;
  1009. }
  1010. else {
  1011. cell = 0;
  1012. hit = 0;
  1013. }
  1014. }
  1015.  
  1016. int hit1 = 0;
  1017. int sd = 7;
  1018.  
  1019. void cell1_hit() {
  1020. if ((blast_x >= cell10_x - 10) && (blast_y >= cell10_y - 10 && blast_y <= cell10_y + 80)) {
  1021. cell1 = 1;
  1022.  
  1023. hit1 = 1;
  1024. score += sd;
  1025. blast_x = 1300;
  1026. }
  1027. else if ((blast1_x >= cell10_x - 10) && (blast1_y >= cell10_y - 10 && blast1_y <= cell10_y + 80)) {
  1028. cell1 = 1;
  1029.  
  1030. hit1 = 1;
  1031. score += sd;
  1032. blast1_x = 1300;
  1033. }
  1034. else if ((blast2_x >= cell10_x - 10) && (blast2_y >= cell10_y - 10 && blast2_y <= cell10_y + 80)) {
  1035. cell1 = 1;
  1036.  
  1037. hit1 = 1;
  1038. score += sd;
  1039. blast2_x = 1300;
  1040. }
  1041. else if ((blast3_x >= cell10_x - 10) && (blast3_y >= cell10_y - 10 && blast3_y <= cell10_y + 80)) {
  1042. cell1 = 1;
  1043.  
  1044. hit1 = 1;
  1045. score += sd;
  1046. blast3_x = 1300;
  1047. }
  1048. else if ((blast4_x >= cell10_x - 10) && (blast4_y >= cell10_y - 10 && blast4_y <= cell10_y + 80)) {
  1049. cell1 = 1;
  1050.  
  1051. hit1 = 1;
  1052. score += sd;
  1053. blast4_x = 1300;
  1054. }
  1055. else if ((blast5_x >= cell10_x - 10) && (blast5_y >= cell10_y - 10 && blast5_y <= cell10_y + 80)) {
  1056. cell1 = 1;
  1057.  
  1058. hit1 = 1;
  1059. score += sd;
  1060. blast5_x = 1300;
  1061. }
  1062. else if ((blast6_x >= cell10_x - 10) && (blast6_y >= cell10_y - 10 && blast6_y <= cell10_y + 80)) {
  1063. cell1 = 1;
  1064.  
  1065. hit1 = 1;
  1066. score += sd;
  1067. blast6_x = 1300;
  1068. }
  1069. else if ((blast7_x >= cell10_x - 10) && (blast7_y >= cell10_y - 10 && blast7_y <= cell10_y + 80)) {
  1070. cell1 = 1;
  1071.  
  1072. hit1 = 1;
  1073. score += sd;
  1074. blast7_x = 1300;
  1075. }
  1076. else if ((blast8_x >= cell10_x - 10) && (blast8_y >= cell10_y - 10 && blast8_y <= cell10_y + 80)) {
  1077. cell1 = 1;
  1078.  
  1079. hit1 = 1;
  1080. score += sd;
  1081. blast8_x = 1300;
  1082. }
  1083. else if ((blast9_x >= cell10_x - 10) && (blast9_y >= cell10_y - 10 && blast9_y <= cell10_y + 80)) {
  1084. cell1 = 1;
  1085.  
  1086. hit1 = 1;
  1087. score += sd;
  1088. blast9_x = 1300;
  1089. }
  1090. else {
  1091. cell1 = 0;
  1092. hit1 = 0;
  1093. }
  1094.  
  1095. }
  1096. int hit2 = 0;
  1097. int sd1 = 10;
  1098. void cell2_hit() {
  1099. if ((blast_x >= cell20_x - 10) && (blast_y >= cell20_y - 10 && blast_y <= cell20_y + 80)) {
  1100. cell2 = 1;
  1101.  
  1102. hit2 = 1;
  1103. score += sd1;
  1104. blast_x = 1300;
  1105. }
  1106. else if ((blast1_x >= cell20_x - 10) - 10 && (blast1_y >= cell20_y - 10 && blast1_y <= cell20_y + 80)) {
  1107. cell2 = 1;
  1108. hit2 = 1;
  1109.  
  1110. score += sd1;
  1111. blast1_x = 1300;
  1112. }
  1113. else if ((blast2_x >= cell20_x - 10) && (blast2_y >= cell20_y - 10 && blast2_y <= cell20_y + 80)) {
  1114. cell2 = 1;
  1115.  
  1116. hit2 = 1;
  1117. score += sd1;
  1118. blast2_x = 1300;
  1119. }
  1120. else if ((blast3_x >= cell20_x - 10) && (blast3_y >= cell20_y - 10 && blast3_y <= cell20_y + 80)) {
  1121. cell2 = 1;
  1122.  
  1123. hit2 = 1;
  1124. score += sd1;
  1125. blast3_x = 1300;
  1126. }
  1127. else if ((blast4_x >= cell20_x - 10) && (blast4_y >= cell20_y - 10 && blast4_y <= cell20_y + 80)) {
  1128. cell2 = 1;
  1129.  
  1130. hit2 = 1;
  1131. score += sd1;
  1132. blast4_x = 1300;
  1133. }
  1134. else if ((blast5_x >= cell20_x - 10) && (blast5_y >= cell20_y - 10 && blast5_y <= cell20_y + 80)) {
  1135. cell2 = 1;
  1136.  
  1137. hit2 = 1;
  1138. score += sd1;
  1139. blast5_x = 1300;
  1140. }
  1141. else if ((blast6_x >= cell20_x - 10) && (blast6_y >= cell20_y - 10 && blast6_y <= cell20_y + 80)) {
  1142. cell2 = 1;
  1143.  
  1144. hit2 = 1;
  1145. score += sd1;
  1146. blast6_x = 1300;
  1147. }
  1148. else if ((blast7_x >= cell20_x - 10) && (blast7_y >= cell20_y - 10 && blast7_y <= cell20_y + 80)) {
  1149. cell2 = 1;
  1150.  
  1151. hit2 = 1;
  1152. score += sd1;
  1153. blast7_x = 1300;
  1154. }
  1155. else if ((blast8_x >= cell20_x - 10) && (blast8_y >= cell20_y - 10 && blast8_y <= cell20_y + 80)) {
  1156. cell2 = 1;
  1157.  
  1158. hit2 = 1;
  1159. score += sd1;
  1160. blast8_x = 1300;
  1161. }
  1162. else if ((blast9_x >= cell20_x - 10) && (blast9_y >= cell20_y - 10 && blast9_y <= cell20_y + 80)) {
  1163. cell2 = 1;
  1164.  
  1165. hit2 = 1;
  1166. score += sd1;
  1167. blast9_x = 1300;
  1168. }
  1169. else {
  1170. cell2 = 0;
  1171. hit2 = 0;
  1172. }
  1173. }
  1174.  
  1175.  
  1176. //obs
  1177.  
  1178.  
  1179. int randomob = 1;
  1180. int obs;
  1181. int obs_speed = 8;
  1182.  
  1183. int obs_y = 140;
  1184. int obs1_x = 1700;
  1185.  
  1186. int obs2_x = 2200;
  1187. int obs3_x = 3000;
  1188.  
  1189.  
  1190.  
  1191. void obstacle() {
  1192.  
  1193. if (randomob == 1) {
  1194. obs = 1;
  1195.  
  1196. }
  1197. if (randomob == 2) {
  1198. obs = 2;
  1199.  
  1200. }
  1201. if (randomob == 3) {
  1202. obs = 3;
  1203.  
  1204. }
  1205.  
  1206. if (obs == 1) {
  1207. obs1_x -= obs_speed;
  1208. if (obs1_x < 0) {
  1209. obs1_x = 1400;
  1210.  
  1211. randomob = rand() % 4;
  1212. }
  1213.  
  1214. }
  1215. if (obs == 2) {
  1216. obs2_x -= obs_speed;
  1217. if (obs2_x <= 0) {
  1218. obs2_x = 1550;
  1219.  
  1220. randomob = rand() % 4;
  1221. }
  1222.  
  1223. }
  1224. if (obs == 3) {
  1225. obs3_x -= obs_speed;
  1226. if (obs3_x <= 0) {
  1227. obs3_x = 1650;
  1228.  
  1229. randomob = rand() % 4;
  1230. }
  1231.  
  1232. }
  1233.  
  1234. }
  1235.  
  1236. int bck_speed = 1;
  1237.  
  1238. int bck_x = 128;
  1239. int bck_x1 = 256;
  1240. int bck_x2 = 384;
  1241. int bck_x3 = 512;
  1242. int bck_x4 = 640;
  1243. int bck_x5 = 768;
  1244. int bck_x6 = 896;
  1245. int bck_x7 = 1024;
  1246. int bck_x8 = 1152;
  1247. int bck_x9 = 1280;
  1248. int bck_x10 = 1408;
  1249.  
  1250.  
  1251. void background() {
  1252. bck_x -= bck_speed;
  1253. bck_x1 -= bck_speed;
  1254. bck_x2 -= bck_speed;
  1255. bck_x3 -= bck_speed;
  1256. bck_x4 -= bck_speed;
  1257. bck_x5 -= bck_speed;
  1258. bck_x6 -= bck_speed;
  1259. bck_x7 -= bck_speed;
  1260. bck_x8 -= bck_speed;
  1261. bck_x9 -= bck_speed;
  1262. bck_x10 -= bck_speed;
  1263.  
  1264.  
  1265. if (bck_x < 0) {
  1266. bck_x = 1403;
  1267. }
  1268. if (bck_x1 < 0) {
  1269. bck_x1 = 1403;
  1270. }
  1271. if (bck_x2 < 0) {
  1272. bck_x2 = 1403;
  1273. }
  1274. if (bck_x3 < 0) {
  1275. bck_x3 = 1403;
  1276. }
  1277. if (bck_x4 <0) {
  1278. bck_x4 = 1403;
  1279. }
  1280. if (bck_x5 < 0) {
  1281. bck_x5 = 1403;
  1282. }
  1283. if (bck_x6 < 0) {
  1284. bck_x6 = 1403;
  1285. }
  1286. if (bck_x7 < 0) {
  1287. bck_x7 = 1403;
  1288. }
  1289. if (bck_x8 < 0) {
  1290. bck_x8 = 1403;
  1291. }
  1292. if (bck_x9 < 0) {
  1293. bck_x9 = 1403;
  1294. }
  1295. if (bck_x10 < 0) {
  1296. bck_x10 = 1403;
  1297. }
  1298.  
  1299.  
  1300. }
  1301.  
  1302.  
  1303. void goku_hit() {
  1304.  
  1305. if ((cell_x >= goku_x - 30 && cell_x <= goku_x + 35) && (cell_y >= jump_y - 40 && cell_y <= jump_y + 70)) {
  1306. cell = 1;
  1307. damage -= cell_damage;
  1308. }
  1309. if ((cell10_x >= goku_x - 30 && cell10_x <= goku_x + 35) && (cell10_y >= jump_y - 40 && cell10_y <= jump_y + 70)) {
  1310. cell1 = 1;
  1311. damage -= cell_damage;
  1312. }
  1313. if ((cell20_x >= goku_x - 30 && cell20_x <= goku_x + 35) && (cell20_y >= jump_y - 40 && cell20_y <= jump_y + 70)) {
  1314. cell2 = 1;
  1315. damage -= cell_damage;
  1316. }
  1317.  
  1318. }
  1319.  
  1320.  
  1321. //goku walk on obstacle
  1322. int k = 1;
  1323. int obss = 0;
  1324. int obss_y = obs_y + 150;
  1325.  
  1326. int obss1_y = obs_y + 326;
  1327.  
  1328. int obss2_y = obs_y + 520;
  1329.  
  1330.  
  1331. void goku_run_obstacle_s() {
  1332.  
  1333. if ((goku_x >= obs1_x - 10 && goku_x <= obs1_x + 278) && (jump_y > 170 && jump_y <= obss_y)) {
  1334. k = 0;
  1335. jump_y = obss_y - 25;
  1336. }
  1337. else if ((goku_x >= obs2_x - 10 && goku_x <= obs2_x + 278) && (jump_y > 400 && jump_y <= obss1_y)) {
  1338. k = 0;
  1339. jump_y = obss1_y - 25;
  1340. }
  1341. else if ((goku_x >= obs3_x - 10 && goku_x <= obs3_x + 278) && (jump_y > 600 && jump_y <= obss2_y)) {
  1342. k = 0;
  1343. jump_y = obss2_y - 25;
  1344. }
  1345. else {
  1346. k = 1;
  1347. }
  1348. }
  1349. void goku_obstacle_hit(){
  1350.  
  1351. if ((goku_x >= obs1_x - 30 && goku_x <= obs1_x + 278) && (jump_y <= obss_y - 30)) {
  1352. obs1_x = -100;
  1353. damage = damage - 50;
  1354. }
  1355. else if ((goku_x >= obs2_x - 30 && goku_x <= obs2_x + 278) && (jump_y <= obss1_y - 30)) {
  1356. obs2_x = -100;
  1357. damage = damage - 100;
  1358. }
  1359. else if ((goku_x >= obs3_x - 30 && goku_x <= obs3_x + 278) && (jump_y <= obss2_y - 30)) {
  1360. obs3_x = -100;
  1361. damage = damage - 150;
  1362. }
  1363. }
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369. void blast_obs(){
  1370. if ((blast_x >= obs1_x && blast_x <= obs1_x + 278) && (blast_y <= obss_y) && blast_y != 0) {
  1371. obs_bl++;
  1372. blast_x = 1300;
  1373. }
  1374. else if ((blast1_x >= obs1_x && blast1_x <= obs1_x + 278) && (blast1_y <= obss_y) && blast1_y != 0) {
  1375. obs_bl++;
  1376. blast1_x = 1300;
  1377. }
  1378. else if ((blast2_x >= obs1_x && blast2_x <= obs1_x + 278) && (blast2_y <= obss_y) && blast2_y != 0) {
  1379. obs_bl++;
  1380. blast2_x = 1300;
  1381. }
  1382. else if ((blast3_x >= obs1_x && blast3_x <= obs1_x + 278) && (blast3_y <= obss_y) && blast3_y != 0) {
  1383. obs_bl++;
  1384. blast3_x = 1300;
  1385. }
  1386. else if ((blast4_x >= obs1_x && blast4_x <= obs1_x + 278) && (blast4_y <= obss_y) && blast4_y != 0) {
  1387. obs_bl++;
  1388. blast4_x = 1300;
  1389. }
  1390. else if ((blast5_x >= obs1_x && blast5_x <= obs1_x + 278) && (blast5_y <= obss_y) && blast5_y != 0) {
  1391. obs_bl++;
  1392. blast5_x = 1300;
  1393. }
  1394. else if ((blast6_x >= obs1_x && blast6_x <= obs1_x + 278) && (blast6_y <= obss_y) && blast6_y != 0) {
  1395. obs_bl++;
  1396. blast6_x = 1300;
  1397. }
  1398. else if ((blast7_x >= obs1_x && blast7_x <= obs1_x + 278) && (blast7_y <= obss_y) && blast7_y != 0) {
  1399. obs_bl++;
  1400. blast7_x = 1300;
  1401. }
  1402. else if ((blast8_x >= obs1_x && blast8_x <= obs1_x + 278) && (blast8_y <= obss_y) && blast8_y != 0) {
  1403. obs_bl++;
  1404. blast8_x = 1300;
  1405. }
  1406. else if ((blast9_x >= obs1_x && blast9_x <= obs1_x + 278) && (blast9_y <= obss_y) && blast9_y != 0) {
  1407. obs_bl++;
  1408. blast9_x = 1300;
  1409. }
  1410. else if ((blast_x >= obs2_x && blast_x <= obs2_x + 278) && (blast_y <= obss1_y) && blast_y != 0) {
  1411. obm_bl++;
  1412. blast_x = 1300;
  1413. }
  1414. else if ((blast1_x >= obs2_x && blast1_x <= obs2_x + 278) && (blast1_y <= obss1_y) && blast1_y != 0) {
  1415. obm_bl++;
  1416. blast1_x = 1300;
  1417. }
  1418. else if ((blast2_x >= obs2_x && blast2_x <= obs2_x + 278) && (blast2_y <= obss1_y) && blast2_y != 0) {
  1419. obm_bl++;
  1420. blast2_x = 1300;
  1421. }
  1422. else if ((blast3_x >= obs2_x && blast3_x <= obs2_x + 278) && (blast3_y <= obss1_y) && blast3_y != 0) {
  1423. obm_bl++;
  1424. blast3_x = 1300;
  1425. }
  1426. else if ((blast4_x >= obs2_x && blast4_x <= obs2_x + 278) && (blast4_y <= obss1_y) && blast4_y != 0) {
  1427. obm_bl++;
  1428. blast4_x = 1300;
  1429. }
  1430. else if ((blast5_x >= obs2_x && blast5_x <= obs2_x + 278) && (blast5_y <= obss1_y) && blast5_y != 0) {
  1431. obm_bl++;
  1432. blast5_x = 1300;
  1433. }
  1434. else if ((blast6_x >= obs2_x && blast6_x <= obs2_x + 278) && (blast6_y <= obss1_y) && blast6_y != 0) {
  1435. obm_bl++;
  1436. }
  1437. else if ((blast7_x >= obs2_x && blast7_x <= obs2_x + 278) && (blast7_y <= obss1_y) && blast7_y != 0) {
  1438. obm_bl++;
  1439. blast7_x = 1300;
  1440. }
  1441. else if ((blast8_x >= obs2_x && blast8_x <= obs2_x + 278) && (blast8_y <= obss1_y) && blast8_y != 0) {
  1442. obm_bl++;
  1443. blast8_x = 1300;
  1444. }
  1445. else if ((blast9_x >= obs2_x && blast9_x <= obs2_x + 278) && (blast9_y <= obss1_y) && blast9_y != 0) {
  1446. obm_bl++;
  1447. blast9_x = 1300;
  1448. }
  1449. else if ((blast_x >= obs3_x && blast_x <= obs3_x + 278) && (blast_y <= obss2_y) && blast_y != 0) {
  1450. obl_bl++;
  1451. blast_x = 1300;
  1452. }
  1453. else if ((blast1_x >= obs3_x && blast1_x <= obs3_x + 278) && (blast1_y <= obss2_y) && blast1_y != 0) {
  1454. obl_bl++;
  1455. blast1_x = 1300;
  1456. }
  1457. else if ((blast2_x >= obs3_x && blast2_x <= obs3_x + 278) && (blast2_y <= obss2_y) && blast2_y != 0) {
  1458. obl_bl++;
  1459. blast2_x = 1300;
  1460. }
  1461. else if ((blast3_x >= obs3_x && blast3_x <= obs3_x + 278) && (blast3_y <= obss2_y) && blast3_y != 0) {
  1462. obl_bl++;
  1463. blast3_x = 1300;
  1464. }
  1465. else if ((blast4_x >= obs3_x && blast4_x <= obs3_x + 278) && (blast4_y <= obss2_y) && blast4_y != 0) {
  1466. obl_bl++;
  1467. blast4_x = 1300;
  1468. }
  1469. else if ((blast5_x >= obs3_x && blast5_x <= obs3_x + 278) && (blast5_y <= obss2_y) && blast5_y != 0) {
  1470. obl_bl++;
  1471. blast5_x = 1300;
  1472. }
  1473. else if ((blast6_x >= obs3_x && blast6_x <= obs3_x + 278) && (blast6_y <= obss2_y) && blast6_y != 0) {
  1474. obl_bl++;
  1475. blast6_x = 1300;
  1476. }
  1477. else if ((blast7_x >= obs3_x && blast7_x <= obs3_x + 278) && (blast7_y <= obss2_y) && blast7_y != 0) {
  1478. obl_bl++;
  1479. blast7_x = 1300;
  1480. }
  1481. else if ((blast8_x >= obs3_x && blast8_x <= obs3_x + 278) && (blast8_y <= obss2_y) && blast8_y != 0) {
  1482. obl_bl++;
  1483. blast8_x = 1300;
  1484. }
  1485. else if ((blast9_x >= obs3_x && blast9_x <= obs3_x + 278) && (blast9_y <= obss2_y) && blast9_y != 0) {
  1486. obl_bl++;
  1487. blast9_x = 1300;
  1488. }
  1489. if (obs_bl >= 4)
  1490. {
  1491. obs1_x = -100;
  1492. obs_bl = 0;
  1493. score = score + obscr;
  1494. }
  1495. if (obm_bl >= 6)
  1496. {
  1497. obs2_x = -100;
  1498. obm_bl = 0;
  1499. score = score + obscr1;
  1500. }
  1501. if (obl_bl >= 8)
  1502. {
  1503. obs3_x = -100;
  1504. obl_bl = 0;
  1505. score = score + obscr2;
  1506. }
  1507. }
  1508. int over = 0;
  1509. void GameOver() {
  1510. over++;
  1511. if (over >= 28) {
  1512. over = 28;
  1513. }
  1514. }
  1515.  
  1516. //Senzu bean
  1517. int senzu_x = 2000;
  1518. int senzu_y = 200;
  1519. int senzu_speed = 15;
  1520.  
  1521. int random_senzu;
  1522.  
  1523.  
  1524. int senzu = 1;
  1525.  
  1526. void senzu_bean() {
  1527. senzu_x -= senzu_speed;
  1528. if (senzu_x <= 0 && senzu == 1) {
  1529. senzu_x = 3500;
  1530. random_senzu = rand() % 7;
  1531. }
  1532. if (random_senzu == 1) {
  1533. senzu_y = 320;
  1534. }
  1535. else if (random_senzu == 2) {
  1536. senzu_y = 250;
  1537. }
  1538. else if (random_senzu == 3) {
  1539. senzu_y = 350;
  1540. }
  1541. else if (random_senzu == 4) {
  1542. senzu_y = 400;
  1543. }
  1544. else if (random_senzu == 5) {
  1545. senzu_y = 500;
  1546. }
  1547. else if (random_senzu == 6) {
  1548. senzu_y = 600;
  1549. }
  1550. }
  1551.  
  1552. int flag = 0;
  1553.  
  1554. void senzu_hit() {
  1555. if ((senzu_x <= goku_x + 60 && senzu_x >= goku_x) && (senzu_y >= jump_y - 20 && senzu_y <= jump_y + 70)){
  1556. senzu = 0;
  1557. senzu_x = 4200;
  1558. flag = 1;
  1559. if (flag == 1) {
  1560. damage += 150;
  1561. if (damage >= 1000) {
  1562. damage = 1000;
  1563. }
  1564.  
  1565. }
  1566. flag++;
  1567. }
  1568. else {
  1569. senzu = 1;
  1570. }
  1571. }
  1572.  
  1573.  
  1574.  
  1575. //Dragon ball
  1576. int d = 1;
  1577. int ds = 0;
  1578. int db_x = 2600;
  1579. int db_y = 320;
  1580. int db_speed = 15;
  1581. int db = 0;
  1582. int dr = 1;
  1583. int random_db;
  1584. void dragon_ball_move() {
  1585. if (random_db == 1) {
  1586. db_y = 250;
  1587. }
  1588. else if (random_db == 2) {
  1589. db_y = 150;
  1590. }
  1591. else if (random_db == 3) {
  1592. db_y = 650;
  1593. }
  1594. else if (random_db == 4) {
  1595. db_y = 340;
  1596. }
  1597. else if (random_db == 5) {
  1598. db_y = 500;
  1599. }
  1600. else if (random_db == 6) {
  1601. db_y = 600;
  1602. }
  1603. else if (random_db == 7) {
  1604. db_y = 560;
  1605. }
  1606. db_x -= db_speed;
  1607. if (db_x <= 0) {
  1608. db_x = 4500;
  1609. random_db = rand() % 8;
  1610. }
  1611. }
  1612.  
  1613.  
  1614. void dragon_ball_hit() {
  1615. if ((db_x > goku_x && db_x <= goku_x + 55) && (db_y >= jump_y - 40 && db_y <= jump_y + 90)) {
  1616. d = 0;
  1617. db++;
  1618. db_x = 5000;
  1619. random_db = rand() % 14;
  1620. }
  1621. if (db >= 7){
  1622. ds = 1;
  1623. if (s_anim != 3)
  1624. {
  1625. s_anim = 1;
  1626. super = 2;
  1627. damage = 1000;
  1628. }
  1629. }
  1630. }
  1631.  
  1632.  
  1633. //Frieza move
  1634.  
  1635. int gol_frieza = 0;
  1636.  
  1637. int frieza_x = 2100;
  1638. int frieza_y = 160;
  1639. int frieza_speed = 10;
  1640. int f;
  1641. void frieza_move() {
  1642. frieza_x -= 20;
  1643. if (frieza_x <= 1100) {
  1644. frieza_x = 1100;
  1645. }
  1646. if (f == 0){
  1647. frieza_y += frieza_speed;
  1648. if (frieza_y >= 700) {
  1649. f = 1;
  1650. }
  1651. }
  1652. if (f == 1) {
  1653. frieza_y -= frieza_speed;
  1654. if (frieza_y <= 160) {
  1655. f = 0;
  1656. }
  1657. }
  1658. }
  1659.  
  1660.  
  1661. //Frieza blast
  1662. int f_blast_x = frieza_x;
  1663. int f_blast1_x = frieza_x;
  1664. int f_blast = 0;
  1665. int f_blast2_x = frieza_x;
  1666. int f_blast1 = 0;
  1667. int f_blast3_x = frieza_x;
  1668. int f_blast2 = 0;
  1669. int f_blast4_x = frieza_x;
  1670. int f_blast3 = 0;
  1671. int f_blast_y = frieza_y + 27;
  1672. int f_blast1_y = frieza_y + 27;
  1673. int f_blast2_y = frieza_y + 27;
  1674. int f_blast3_y = frieza_y + 27;
  1675. int f_blast4_y = frieza_y + 27;
  1676. int f_blast_speed = 27;
  1677. int f_blast4 = 0;
  1678. int f_b = 0;
  1679.  
  1680. int f_b1 = 0;
  1681. int f_b2 = 0;
  1682. int f_b3 = 0;
  1683. int f_b4 = 0;
  1684. int f_ap;
  1685. int ff = 0;
  1686. int ff1 = 0;
  1687. int ff2 = 0;
  1688. int ff3 = 0;
  1689. int ff4 = 0;
  1690.  
  1691. int fs;
  1692. int fbl;
  1693.  
  1694. void frieza_blast() {
  1695.  
  1696. if (gol_frieza == 0) {
  1697. if (frieza_y < 180) {
  1698. ff = 0;
  1699. f_b = f_blast;
  1700. f_blast_x = frieza_x - 20;
  1701. f_blast_y = frieza_y + 27;
  1702. f_ap = 2;
  1703. }
  1704. if (frieza_y > 180 && frieza_y < 350) {
  1705. f_ap = 0;
  1706. }
  1707. if (frieza_y > 350 && frieza_y < 430) {
  1708. ff1 = 0;
  1709. f_b1 = f_blast1;
  1710. f_blast1_x = frieza_x - 20;
  1711. f_blast1_y = frieza_y + 27;
  1712. if (frieza_y < 400) {
  1713. f_ap = 3;
  1714. }
  1715. else
  1716. f_ap = 1;
  1717.  
  1718. }
  1719. if (frieza_y > 430 && frieza_y < 480) {
  1720. ff2 = 0;
  1721. f_b2 = f_blast2;
  1722. f_blast2_x = frieza_x - 20;
  1723. f_blast2_y = frieza_y + 27;
  1724. f_ap = 2;
  1725. }
  1726. if (frieza_y > 490 && frieza_y < 560) {
  1727. ff3 = 0;
  1728. f_b3 = f_blast3;
  1729. f_blast3_x = frieza_x - 20;
  1730. f_blast3_y = frieza_y + 27;
  1731.  
  1732. f_ap = 1;
  1733.  
  1734. }
  1735. if (frieza_y > 560 && frieza_y < 650) {
  1736. f_ap = 0;
  1737. if (frieza_y < 600) {
  1738. f_ap = 3;
  1739. }
  1740. }
  1741.  
  1742. if (frieza_y > 650) {
  1743. ff4 = 0;
  1744. f_b4 = f_blast4;
  1745. f_blast4_x = frieza_x - 20;
  1746. f_blast4_y = frieza_y + 27;
  1747. f_ap = 2;
  1748. }
  1749.  
  1750.  
  1751.  
  1752. if (ff == 0) {
  1753. if (f_b == f_blast) {
  1754. f_blast_x -= f_blast_speed;
  1755. }
  1756. }
  1757. else if (ff == 1) {
  1758. f_blast_x = 2300;
  1759. }
  1760. if (ff1 == 0) {
  1761. if (f_b == f_blast1) {
  1762. f_blast1_x -= f_blast_speed;
  1763. }
  1764. }
  1765. else if (ff1 == 1) {
  1766. f_blast1_x = 2300;
  1767. }
  1768. if (ff2 == 0) {
  1769. if (f_b == f_blast2) {
  1770. f_blast2_x -= f_blast_speed;
  1771. }
  1772. }
  1773. else if (ff2 == 1) {
  1774. f_blast2_x = 2300;
  1775. }
  1776. if (ff3 == 0) {
  1777. if (f_b == f_blast3) {
  1778. f_blast3_x -= f_blast_speed;
  1779. }
  1780. }
  1781. else if (ff3 == 1) {
  1782. f_blast3_x = 2300;
  1783. }
  1784. if (ff4 == 0) {
  1785. if (f_b == f_blast4) {
  1786. f_blast4_x -= f_blast_speed;
  1787. }
  1788. }
  1789. else if (ff4 == 1) {
  1790. f_blast4_x = 2300;
  1791. }
  1792. }
  1793.  
  1794.  
  1795.  
  1796.  
  1797. else if (gol_frieza == 1) {
  1798. if (frieza_y < 180) {
  1799. ff = 0;
  1800. f_b = f_blast;
  1801. f_blast_x = frieza_x - 20;
  1802. f_blast_y = frieza_y + 27;
  1803. f_ap = 2;
  1804. }
  1805. if (frieza_y > 180 && frieza_y < 350) {
  1806. f_ap = 0;
  1807. }
  1808. if (frieza_y > 350 && frieza_y < 430) {
  1809. ff1 = 0;
  1810. f_b1 = f_blast1;
  1811. f_blast1_x = frieza_x - 20;
  1812. f_blast1_y = frieza_y + 27;
  1813. if (frieza_y < 400) {
  1814. f_ap = 3;
  1815. }
  1816. else
  1817. f_ap = 1;
  1818.  
  1819. }
  1820. if (frieza_y > 430 && frieza_y < 480) {
  1821. ff2 = 0;
  1822. f_b2 = f_blast2;
  1823. f_blast2_x = frieza_x - 20;
  1824. f_blast2_y = frieza_y + 27;
  1825. f_ap = 2;
  1826. }
  1827. if (frieza_y > 490 && frieza_y < 560) {
  1828. ff3 = 0;
  1829. f_b3 = f_blast3;
  1830. f_blast3_x = frieza_x - 20;
  1831. f_blast3_y = frieza_y + 27;
  1832.  
  1833. f_ap = 1;
  1834.  
  1835. }
  1836. if (frieza_y > 560 && frieza_y < 650) {
  1837. f_ap = 0;
  1838. if (frieza_y < 600) {
  1839. f_ap = 3;
  1840. }
  1841. }
  1842.  
  1843. if (frieza_y > 650) {
  1844. ff4 = 0;
  1845. f_b4 = f_blast4;
  1846. f_blast4_x = frieza_x - 20;
  1847. f_blast4_y = frieza_y + 27;
  1848. f_ap = 2;
  1849. }
  1850.  
  1851.  
  1852.  
  1853. if (ff == 0) {
  1854. if (f_b == f_blast) {
  1855. f_blast_x -= f_blast_speed;
  1856. }
  1857. }
  1858. else if (ff == 1) {
  1859. f_blast_x = 2300;
  1860. }
  1861. if (ff1 == 0) {
  1862. if (f_b == f_blast1) {
  1863. f_blast1_x -= f_blast_speed;
  1864. }
  1865. }
  1866. else if (ff1 == 1) {
  1867. f_blast1_x = 2300;
  1868. }
  1869. if (ff2 == 0) {
  1870. if (f_b == f_blast2) {
  1871. f_blast2_x -= f_blast_speed;
  1872. }
  1873. }
  1874. else if (ff2 == 1) {
  1875. f_blast2_x = 2300;
  1876. }
  1877. if (ff3 == 0) {
  1878. if (f_b == f_blast3) {
  1879. f_blast3_x -= f_blast_speed;
  1880. }
  1881. }
  1882. else if (ff3 == 1) {
  1883. f_blast3_x = 2300;
  1884. }
  1885. if (ff4 == 0) {
  1886. if (f_b == f_blast4) {
  1887. f_blast4_x -= f_blast_speed;
  1888. }
  1889. }
  1890. else if (ff4 == 1) {
  1891. f_blast4_x = 2300;
  1892. }
  1893.  
  1894. }
  1895. }
  1896.  
  1897.  
  1898.  
  1899.  
  1900. void frieza_blast_goku_blast() {
  1901.  
  1902. if ((blast_x >= f_blast_x - 10 && blast_x <= f_blast_x + 44) && (blast_y >= f_blast_y - 30 && blast_y <= f_blast_y + 80)) {
  1903.  
  1904. blast_x = 1300;
  1905. score += fbl;
  1906. ff = 1;
  1907.  
  1908. }
  1909. else if ((blast1_x >= f_blast_x - 10 && blast1_x <= f_blast_x + 44) && (blast1_y >= f_blast_y - 30 && blast1_y <= f_blast_y + 80)) {
  1910. blast1_x = 1300;
  1911. score += fbl;
  1912. ff = 1;
  1913. }
  1914. else if ((blast2_x >= f_blast_x - 10 && blast2_x <= f_blast_x + 44) && (blast2_y >= f_blast_y - 30 && blast2_y <= f_blast_y + 80)) {
  1915. blast2_x = 1300;
  1916. score += fbl;
  1917. ff = 1;
  1918. }
  1919. else if ((blast3_x >= f_blast_x - 10 && blast3_x <= f_blast_x + 44) && (blast3_y >= f_blast_y - 30 && blast3_y <= f_blast_y + 80)) {
  1920. blast3_x = 1300;
  1921. score += fbl;
  1922. ff = 1;
  1923. }
  1924. else if ((blast4_x >= f_blast_x - 10 && blast4_x <= f_blast_x + 44) && (blast4_y >= f_blast_y - 30 && blast4_y <= f_blast_y + 80)) {
  1925. blast4_x = 1300;
  1926. score += fbl;
  1927. ff = 1;
  1928. }
  1929. else if ((blast5_x >= f_blast_x - 10 && blast5_x <= f_blast_x + 44) && (blast5_y >= f_blast_y - 30 && blast5_y <= f_blast_y + 80)) {
  1930. blast5_x = 1300;
  1931. score += fbl;
  1932. ff = 1;
  1933. }
  1934. else if ((blast6_x >= f_blast_x - 10 && blast6_x <= f_blast_x + 44) && (blast6_y >= f_blast_y - 30 && blast6_y <= f_blast_y + 80)) {
  1935. blast6_x = 1300;
  1936. score += fbl;
  1937. ff = 1;
  1938. }
  1939. else if ((blast7_x >= f_blast_x - 10 && blast7_x <= f_blast_x + 44) && (blast7_y >= f_blast_y - 30 && blast7_y <= f_blast_y + 80)) {
  1940. blast7_x = 1300;
  1941. score += fbl;
  1942. ff = 1;
  1943. }
  1944. else if ((blast8_x >= f_blast_x - 10 && blast8_x <= f_blast_x + 44) && (blast8_y >= f_blast_y - 30 && blast8_y <= f_blast_y + 80)) {
  1945. blast8_x = 1300;
  1946. score += fbl;
  1947. ff = 1;
  1948. }
  1949. else if ((blast9_x >= f_blast_x - 10 && blast9_x <= f_blast_x + 44) && (blast9_y >= f_blast_y - 30 && blast9_y <= f_blast_y + 80)) {
  1950. blast9_x = 1300;
  1951. score += fbl;
  1952. ff = 1;
  1953. }
  1954.  
  1955.  
  1956.  
  1957.  
  1958. else if ((blast_x >= f_blast1_x - 10 && blast_x <= f_blast1_x + 44) && (blast_y >= f_blast1_y - 30 && blast_y <= f_blast1_y + 80)) {
  1959. blast_x = 1300;
  1960. score += fbl;
  1961. ff1 = 1;
  1962. }
  1963. else if ((blast1_x >= f_blast1_x - 10 && blast1_x <= f_blast1_x + 44) && (blast1_y >= f_blast1_y - 30 && blast1_y <= f_blast1_y + 80)) {
  1964. blast1_x = 1300;
  1965. score += fbl;
  1966. ff1 = 1;
  1967. }
  1968. else if ((blast2_x >= f_blast1_x - 10 && blast2_x <= f_blast1_x + 44) && (blast2_y >= f_blast1_y - 30 && blast2_y <= f_blast1_y + 80)) {
  1969. blast2_x = 1300;
  1970. score += fbl;
  1971. ff1 = 1;
  1972.  
  1973. }
  1974. else if ((blast3_x >= f_blast1_x - 10 && blast3_x <= f_blast1_x + 44) && (blast3_y >= f_blast1_y - 30 && blast3_y <= f_blast1_y + 80)) {
  1975. blast3_x = 1300;
  1976. score += fbl;
  1977. ff1 = 1;
  1978. }
  1979. else if ((blast4_x >= f_blast1_x - 10 && blast4_x <= f_blast1_x + 44) && (blast4_y >= f_blast1_y - 30 && blast4_y <= f_blast1_y + 80)) {
  1980. blast4_x = 1300;
  1981. score += fbl;
  1982. ff1 = 1;
  1983. }
  1984. else if ((blast5_x >= f_blast1_x - 10 && blast5_x <= f_blast1_x + 44) && (blast5_y >= f_blast1_y - 30 && blast5_y <= f_blast1_y + 80)) {
  1985. blast5_x = 1300;
  1986. score += fbl;
  1987. ff1 = 1;
  1988. }
  1989. else if ((blast6_x >= f_blast1_x - 10 && blast6_x <= f_blast1_x + 44) && (blast6_y >= f_blast1_y - 30 && blast6_y <= f_blast1_y + 80)) {
  1990. blast6_x = 1300;
  1991. score += fbl;
  1992. ff1 = 1;
  1993. }
  1994. else if ((blast7_x >= f_blast1_x - 10 && blast7_x <= f_blast1_x + 44) && (blast7_y >= f_blast1_y - 30 && blast7_y <= f_blast1_y + 80)) {
  1995. blast7_x = 1300;
  1996. score += fbl;
  1997. ff1 = 1;
  1998. }
  1999. else if ((blast8_x >= f_blast1_x - 10 && blast8_x <= f_blast1_x + 44) && (blast8_y >= f_blast1_y - 30 && blast8_y <= f_blast1_y + 80)) {
  2000. blast8_x = 1300;
  2001. score += fbl;
  2002. ff1 = 1;
  2003. }
  2004. else if ((blast9_x >= f_blast1_x - 10 && blast9_x <= f_blast1_x + 44) && (blast9_y >= f_blast1_y - 30 && blast9_y <= f_blast1_y + 80)) {
  2005. blast9_x = 1300;
  2006. score += fbl;
  2007. ff1 = 1;
  2008. }
  2009.  
  2010. else if ((blast_x >= f_blast2_x - 10 && blast_x <= f_blast2_x + 44) && (blast_y >= f_blast2_y - 30 && blast_y <= f_blast2_y + 80)) {
  2011.  
  2012. blast_x = 1300;
  2013. score += fbl;
  2014. ff2 = 1;
  2015. }
  2016. else if ((blast1_x >= f_blast2_x - 10 && blast1_x <= f_blast2_x + 44) && (blast1_y >= f_blast2_y - 30 && blast1_y <= f_blast2_y + 80)) {
  2017. blast1_x = 1300;
  2018. score += fbl;
  2019. ff2 = 1;
  2020. }
  2021. else if ((blast2_x >= f_blast2_x - 10 && blast2_x <= f_blast2_x + 44) && (blast2_y >= f_blast2_y - 30 && blast2_y <= f_blast2_y + 80)) {
  2022. blast2_x = 1300;
  2023. score += fbl;
  2024. ff2 = 1;
  2025.  
  2026. }
  2027. else if ((blast3_x >= f_blast2_x - 10 && blast3_x <= f_blast2_x + 44) && (blast3_y >= f_blast2_y - 30 && blast3_y <= f_blast2_y + 80)) {
  2028. blast3_x = 1300;
  2029. score += fbl;
  2030. ff2 = 1;
  2031. }
  2032. else if ((blast4_x >= f_blast2_x - 10 && blast4_x <= f_blast2_x + 44) && (blast4_y >= f_blast2_y - 30 && blast4_y <= f_blast2_y + 80)) {
  2033. blast4_x = 1300;
  2034. score += fbl;
  2035. ff2 = 1;
  2036. }
  2037. else if ((blast5_x >= f_blast2_x - 10 && blast5_x <= f_blast2_x + 44) && (blast5_y >= f_blast2_y - 30 && blast5_y <= f_blast2_y + 80)) {
  2038. blast5_x = 1300;
  2039. score += fbl;
  2040. ff2 = 1;
  2041. }
  2042. else if ((blast6_x >= f_blast2_x - 10 && blast6_x <= f_blast2_x + 44) && (blast6_y >= f_blast2_y - 30 && blast6_y <= f_blast2_y + 80)) {
  2043. blast6_x = 1300;
  2044. score += fbl;
  2045. ff2 = 1;
  2046. }
  2047. else if ((blast7_x >= f_blast2_x - 10 && blast7_x <= f_blast2_x + 44) && (blast7_y >= f_blast2_y - 30 && blast7_y <= f_blast2_y + 80)) {
  2048. blast7_x = 1300;
  2049. score += fbl;
  2050. ff2 = 1;
  2051. }
  2052. else if ((blast8_x >= f_blast2_x - 10 && blast8_x <= f_blast2_x + 44) && (blast8_y >= f_blast2_y - 30 && blast8_y <= f_blast2_y + 80)) {
  2053. blast8_x = 1300;
  2054. score += fbl;
  2055. ff2 = 1;
  2056. }
  2057. else if ((blast9_x >= f_blast2_x - 10 && blast9_x <= f_blast2_x + 44) && (blast9_y >= f_blast2_y - 30 && blast9_y <= f_blast2_y + 80)) {
  2058. blast9_x = 1300;
  2059. score += fbl;
  2060. ff2 = 1;
  2061. }
  2062.  
  2063. else if ((blast_x >= f_blast3_x - 10 && blast_x <= f_blast3_x + 44) && (blast_y >= f_blast3_y - 30 && blast_y <= f_blast3_y + 80)) {
  2064.  
  2065. blast_x = 1300;
  2066. score += fbl;
  2067. ff3 = 1;
  2068. }
  2069. else if ((blast1_x >= f_blast3_x - 10 && blast1_x <= f_blast3_x + 44) && (blast1_y >= f_blast3_y - 30 && blast1_y <= f_blast3_y + 80)) {
  2070. blast1_x = 1300;
  2071. score += fbl;
  2072. ff3 = 1;
  2073. }
  2074. else if ((blast2_x >= f_blast3_x - 10 && blast2_x <= f_blast3_x + 44) && (blast2_y >= f_blast3_y - 30 && blast2_y <= f_blast3_y + 80)) {
  2075. blast2_x = 1300;
  2076. score += fbl;
  2077. ff3 = 1;
  2078.  
  2079. }
  2080. else if ((blast3_x >= f_blast3_x - 10 && blast3_x <= f_blast3_x + 44) && (blast3_y >= f_blast3_y - 30 && blast3_y <= f_blast3_y + 80)) {
  2081. blast3_x = 1300;
  2082. score += fbl;
  2083. ff3 = 1;
  2084. }
  2085. else if ((blast4_x >= f_blast3_x - 10 && blast4_x <= f_blast3_x + 44) && (blast4_y >= f_blast3_y - 30 && blast4_y <= f_blast3_y + 80)) {
  2086. blast4_x = 1300;
  2087. score += fbl;
  2088. ff3 = 1;
  2089. }
  2090. else if ((blast5_x >= f_blast3_x - 10 && blast5_x <= f_blast3_x + 44) && (blast5_y >= f_blast3_y - 30 && blast5_y <= f_blast3_y + 80)) {
  2091. blast5_x = 1300;
  2092. score += fbl;
  2093. ff3 = 1;
  2094. }
  2095. else if ((blast6_x >= f_blast3_x - 10 && blast6_x <= f_blast3_x + 44) && (blast6_y >= f_blast3_y - 30 && blast6_y <= f_blast3_y + 80)) {
  2096. blast6_x = 1300;
  2097. score += fbl;
  2098. ff3 = 1;
  2099. }
  2100. else if ((blast7_x >= f_blast3_x - 10 && blast7_x <= f_blast3_x + 44) && (blast7_y >= f_blast3_y - 30 && blast7_y <= f_blast3_y + 80)) {
  2101. blast7_x = 1300;
  2102. score += fbl;
  2103. ff3 = 1;
  2104. }
  2105. else if ((blast8_x >= f_blast3_x - 10 && blast8_x <= f_blast3_x + 44) && (blast8_y >= f_blast3_y - 30 && blast8_y <= f_blast3_y + 80)) {
  2106. blast8_x = 1300;
  2107. score += fbl;
  2108. ff3 = 1;
  2109. }
  2110. else if ((blast9_x >= f_blast3_x - 10 && blast9_x <= f_blast3_x + 44) && (blast9_y >= f_blast3_y - 30 && blast9_y <= f_blast3_y + 80)) {
  2111. blast9_x = 1300;
  2112. score += fbl;
  2113. ff3 = 1;
  2114. }
  2115.  
  2116.  
  2117. else if ((blast_x >= f_blast4_x - 10 && blast_x <= f_blast4_x + 44) && (blast_y >= f_blast4_y - 30 && blast_y <= f_blast4_y + 80)) {
  2118.  
  2119. blast_x = 1300;
  2120. score += fbl;
  2121. ff4 = 1;
  2122. }
  2123. else if ((blast1_x >= f_blast4_x - 10 && blast1_x <= f_blast4_x + 44) && (blast1_y >= f_blast4_y - 30 && blast1_y <= f_blast4_y + 80)) {
  2124. blast1_x = 1300;
  2125. score += fbl;
  2126. ff4 = 1;
  2127. }
  2128. else if ((blast2_x >= f_blast4_x - 10 && blast2_x <= f_blast4_x + 44) && (blast2_y >= f_blast4_y - 30 && blast2_y <= f_blast4_y + 80)) {
  2129. blast2_x = 1300;
  2130. score += fbl;
  2131. ff4 = 1;
  2132.  
  2133. }
  2134. else if ((blast3_x >= f_blast4_x - 10 && blast3_x <= f_blast4_x + 44) && (blast3_y >= f_blast4_y - 30 && blast3_y <= f_blast4_y + 80)) {
  2135. blast3_x = 1300;
  2136. score += fbl;
  2137. ff4 = 1;
  2138. }
  2139. else if ((blast4_x >= f_blast4_x - 10 && blast4_x <= f_blast4_x + 44) && (blast4_y >= f_blast4_y - 30 && blast4_y <= f_blast4_y + 80)) {
  2140. blast4_x = 1300;
  2141. score += fbl;
  2142. ff4 = 1;
  2143. }
  2144. else if ((blast5_x >= f_blast4_x - 10 && blast5_x <= f_blast4_x + 44) && (blast5_y >= f_blast4_y - 30 && blast5_y <= f_blast4_y + 80)) {
  2145. blast5_x = 1300;
  2146. score += fbl;
  2147. ff4 = 1;
  2148. }
  2149. else if ((blast6_x >= f_blast4_x - 10 && blast6_x <= f_blast4_x + 44) && (blast6_y >= f_blast4_y - 30 && blast6_y <= f_blast4_y + 80)) {
  2150. blast6_x = 1300;
  2151. score += fbl;
  2152. ff4 = 1;
  2153. }
  2154. else if ((blast7_x >= f_blast4_x - 10 && blast7_x <= f_blast4_x + 44) && (blast7_y >= f_blast4_y - 30 && blast7_y <= f_blast4_y + 80)) {
  2155. blast7_x = 1300;
  2156. score += fbl;
  2157. ff4 = 1;
  2158. }
  2159. else if ((blast8_x >= f_blast4_x - 10 && blast8_x <= f_blast4_x + 44) && (blast8_y >= f_blast4_y - 30 && blast8_y <= f_blast4_y + 80)) {
  2160. blast8_x = 1300;
  2161. score += fbl;
  2162. ff4 = 1;
  2163. }
  2164. else if ((blast9_x >= f_blast4_x - 10 && blast9_x <= f_blast4_x + 44) && (blast9_y >= f_blast4_y - 30 && blast9_y <= f_blast4_y + 80)) {
  2165. blast9_x = 1300;
  2166. score += fbl;
  2167. ff4 = 1;
  2168. }
  2169.  
  2170. }
  2171.  
  2172.  
  2173. int f_damage = 100;
  2174.  
  2175. void frieza_hit(){
  2176. if ((blast_x >= frieza_x + 5 && blast_x <= frieza_x + 60) && (blast_y >= frieza_y - 20 && blast_y <= frieza_y + 70)) {
  2177. frieza_life -= f_damage;
  2178. blast_x = 1300;
  2179. score += fs;
  2180. }
  2181. if ((blast1_x >= frieza_x + 5 && blast1_x <= frieza_x + 60) && (blast1_y >= frieza_y - 20 && blast1_y <= frieza_y + 70)) {
  2182. frieza_life -= f_damage;
  2183. blast1_x = 1300;
  2184. score += fs;
  2185. }
  2186. if ((blast2_x >= frieza_x + 5 && blast2_x <= frieza_x + 60) && (blast2_y >= frieza_y - 20 && blast2_y <= frieza_y + 70)) {
  2187. frieza_life -= f_damage;
  2188. blast2_x = 1300;
  2189. score += fs;
  2190. }
  2191. if ((blast3_x >= frieza_x + 5 && blast3_x <= frieza_x + 60) && (blast3_y >= frieza_y - 20 && blast3_y <= frieza_y + 70)) {
  2192. frieza_life -= f_damage;
  2193. blast3_x = 1300;
  2194. score += fs;
  2195. }
  2196. if ((blast4_x >= frieza_x + 5 && blast4_x <= frieza_x + 60) && (blast4_y >= frieza_y - 20 && blast4_y <= frieza_y + 70)) {
  2197. frieza_life -= f_damage;
  2198. blast4_x = 1300;
  2199. score += fs;
  2200. }
  2201. if ((blast5_x >= frieza_x + 5 && blast5_x <= frieza_x + 60) && (blast5_y >= frieza_y - 20 && blast5_y <= frieza_y + 70)) {
  2202. frieza_life -= f_damage;
  2203. blast5_x = 1300;
  2204. score += fs;
  2205. }
  2206. if ((blast6_x >= frieza_x + 5 && blast6_x <= frieza_x + 60) && (blast6_y >= frieza_y - 20 && blast6_y <= frieza_y + 70)) {
  2207. frieza_life -= f_damage;
  2208. blast6_x = 1300;
  2209. score += fs;
  2210. }
  2211. if ((blast7_x >= frieza_x + 5 && blast7_x <= frieza_x + 60) && (blast7_y >= frieza_y - 20 && blast7_y <= frieza_y + 70)) {
  2212. frieza_life -= f_damage;
  2213. blast7_x = 1300;
  2214. score += fs;
  2215. }
  2216. if ((blast8_x >= frieza_x + 5 && blast8_x <= frieza_x + 60) && (blast8_y >= frieza_y - 20 && blast8_y <= frieza_y + 60)) {
  2217. frieza_life -= f_damage;
  2218. blast8_x = 1300;
  2219. score += fs;
  2220. }
  2221. if ((blast9_x >= frieza_x + 5 && blast9_x <= frieza_x + 60) && (blast9_y >= frieza_y - 20 && blast9_y <= frieza_y + 60)) {
  2222. frieza_life -= f_damage;
  2223. blast9_x = 1300;
  2224. score += fs;
  2225. }
  2226. if (frieza_life <= 1600) {
  2227. gol_frieza = 1;
  2228. f_damage = 70;
  2229. }
  2230. }
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236. void goku_hit_frieza_blast() {
  2237.  
  2238. if ((f_blast_x >= goku_x - 30 && f_blast_x <= goku_x + 35) && (f_blast_y >= jump_y - 20 && f_blast_y <= jump_y + 70)) {
  2239. ff = 1;
  2240. damage -= 50;
  2241. }
  2242. if ((f_blast1_x >= goku_x - 30 && f_blast1_x <= goku_x + 35) && (f_blast1_y >= jump_y - 20 && f_blast1_y <= jump_y + 70)) {
  2243. ff1 = 1;
  2244. damage -= 50;
  2245. }
  2246. if ((f_blast2_x >= goku_x - 30 && f_blast2_x <= goku_x + 35) && (f_blast2_y >= jump_y - 20 && f_blast2_y <= jump_y + 70)) {
  2247. ff2 = 1;
  2248. damage -= 50;
  2249. }
  2250. if ((f_blast3_x >= goku_x - 30 && f_blast3_x <= goku_x + 35) && (f_blast3_y >= jump_y - 20 && f_blast3_y <= jump_y + 70)) {
  2251. ff3 = 1;
  2252. damage -= 50;
  2253. }
  2254. if ((f_blast4_x >= goku_x - 30 && f_blast4_x <= goku_x + 35) && (f_blast4_y >= jump_y - 20 && f_blast4_y <= jump_y + 70)) {
  2255. ff4 = 1;
  2256. damage -= 50;
  2257. }
  2258. }
  2259.  
  2260.  
  2261. int dis = 10;
  2262. void distance() {
  2263. dis += 20;
  2264. }
  2265.  
  2266. int aftr = 1000;
  2267. void after_frieza() {
  2268. if (frieza_life <= 0) {
  2269. aftr += 25;
  2270. }
  2271. if (aftr < 10000){
  2272. cell_speed = 40;
  2273.  
  2274. cell_damage = 150;
  2275. }
  2276. else if (aftr >= 10000) {
  2277. cell_speed = 60;
  2278. cell_damage = 160;
  2279. }
  2280. else if (aftr >= 30000) {
  2281. cell_speed = 80;
  2282. cell_damage = 170;
  2283. }
  2284. else if (aftr >= 50000) {
  2285. cell_speed = 90;
  2286. cell_damage = 180;
  2287. }
  2288. else if (aftr >= 70000) {
  2289. cell_speed = 110;
  2290. cell_damage = 220;
  2291. }
  2292. else if (aftr >= 150000) {
  2293. cell_speed = 140;
  2294. cell_damage = 300;
  2295. }
  2296. }
  2297.  
  2298.  
  2299.  
  2300. void anim(){
  2301. goku_jump();
  2302. cell_move();
  2303. cell_move2();
  2304. cell_move3();
  2305. cell_hit();
  2306. cell1_hit();
  2307. cell2_hit();
  2308. distance();
  2309. if (dis >= 70000) {
  2310. frieza_move();
  2311. frieza_blast();
  2312. frieza_blast_goku_blast();
  2313.  
  2314. goku_hit_frieza_blast();
  2315.  
  2316. frieza_hit();
  2317. }
  2318. groundMovement();
  2319. goku_hit();
  2320. spike_move();
  2321. senzu_bean();
  2322. senzu_hit();
  2323. obstacle();
  2324. goku_run_obstacle_s();
  2325. goku_obstacle_hit();
  2326. blast_obs();
  2327. background();
  2328. spike_hit();
  2329. dragon_ball_move();
  2330. dragon_ball_hit();
  2331. if (super == 1) {
  2332. ss = 15;
  2333. sd = 25;
  2334. sd1 = 35;
  2335. fs = 40;
  2336. fbl = 5;
  2337.  
  2338. obscr = 33;
  2339. obscr1 = 66;
  2340. obscr2 = 99;
  2341.  
  2342. }
  2343.  
  2344. else if (super == 2) {
  2345.  
  2346. ss = 7;
  2347. sd = 15;
  2348. sd1 = 22;
  2349. fs = 25;
  2350. fbl = 3;
  2351.  
  2352. obscr = 15;
  2353. obscr1 = 30;
  2354. obscr2 = 45;
  2355. }
  2356.  
  2357. if (gol_frieza == 1){
  2358. if (gol_anim == 0)
  2359. gol_anim = 1;
  2360. }
  2361.  
  2362. if (frieza_life <= 0) {
  2363. gol_frieza = 0;
  2364. dis = 0;
  2365. frieza_x = 4000;
  2366. f_blast_x = 5000;
  2367. f_blast1_x = 5000;
  2368. f_blast2_x = 5000;
  2369. f_blast3_x = 5000;
  2370. f_blast4_x = 5000;
  2371. after_frieza();
  2372. }
  2373. }
  2374.  
  2375.  
  2376.  
  2377.  
  2378. void all_again() {
  2379.  
  2380. //upper half
  2381. go = 0;
  2382. res = 1;
  2383.  
  2384.  
  2385. aftr = 1000;
  2386. cell_damage = 100;
  2387.  
  2388. obscr;
  2389. obscr1;
  2390. obscr2;
  2391.  
  2392. damage = 1000;
  2393. frieza_life = 3000;
  2394. red;
  2395. green;
  2396.  
  2397.  
  2398. c = 0;
  2399. g = 0;
  2400. s = 0;
  2401.  
  2402.  
  2403. super = 1;
  2404. score = 0;
  2405.  
  2406. run = 0;
  2407. goku_x = 200;
  2408. run_y = 140;
  2409. run_co = 0;
  2410. gr = 0;
  2411. gr1 = 0;
  2412. gr2 = 0;
  2413. gr3 = 0;
  2414. gr4 = 0;
  2415. gr5 = 0;
  2416. gr6 = 0;
  2417. gr7 = 0;
  2418. gr8 = 0;
  2419. gr9 = 0;
  2420.  
  2421. blast_co = 0;
  2422. blast_speed = 25;
  2423.  
  2424. blast = 0;
  2425. blast_x = 240;
  2426. blast_y;
  2427. blast_button = 0;
  2428. blast_flag = 0;
  2429.  
  2430. blast1 = 0;
  2431. blast1_x = 240;
  2432. blast1_y;
  2433. blast1_button = 0;
  2434. blast1_flag = 0;
  2435.  
  2436. blast2 = 0;
  2437. blast2_x = 240;
  2438. blast2_y;
  2439. blast2_button = 0;
  2440. blast2_flag = 0;
  2441.  
  2442. blast3 = 0;
  2443. blast3_x = 240;
  2444. blast3_y;
  2445. blast3_button = 0;
  2446. blast3_flag = 0;
  2447.  
  2448. blast4 = 0;
  2449. blast4_x = 240;
  2450. blast4_y;
  2451. blast4_button = 0;
  2452. blast4_flag = 0;
  2453.  
  2454. blast5 = 0;
  2455. blast5_x = 240;
  2456. blast5_y;
  2457. blast5_button = 0;
  2458. blast5_flag = 0;
  2459.  
  2460. blast6 = 0;
  2461. blast6_x = 240;
  2462. blast6_y;
  2463. blast6_button = 0;
  2464. blast6_flag = 0;
  2465.  
  2466. blast7 = 0;
  2467. blast7_x = 240;
  2468. blast7_y;
  2469. blast7_button = 0;
  2470. blast7_flag = 0;
  2471.  
  2472. blast8 = 0;
  2473. blast8_x = 240;
  2474. blast8_y;
  2475. blast8_button = 0;
  2476. blast8_flag = 0;
  2477.  
  2478. blast9 = 0;
  2479. blast9_x = 240;
  2480. blast9_y;
  2481. blast9_button = 0;
  2482. blast9_flag = 0;
  2483.  
  2484.  
  2485. jump_key = 0;
  2486. jump = 0;
  2487. jump_x = 240;
  2488. jump_y = 140;
  2489. jump_h1 = 150;
  2490. jump_h2 = 260;
  2491. jump_limit = 450;
  2492. jd = 25;
  2493. jump_dif = jd;
  2494. jump_co = 0;
  2495.  
  2496.  
  2497. ground_y = 0;
  2498. ground_x = 128;
  2499. ground_x1 = 256;
  2500. ground_x2 = 384;
  2501. ground_x3 = 512;
  2502. ground_x4 = 640;
  2503. ground_x5 = 768;
  2504. ground_x6 = 896;
  2505. ground_x7 = 1024;
  2506. ground_x8 = 1152;
  2507. ground_x9 = 1280;
  2508. ground_x10 = 1408;
  2509.  
  2510.  
  2511. gdx = 8;
  2512. cloud_position_x = 500;
  2513. cloud_position_y = 520;
  2514. cloud2_position_x = 900;
  2515. cloud2_position_y = 620;
  2516. cloud1_position_x = 2350;
  2517. cloud1_position_y = 670;
  2518. jumping = 0;
  2519.  
  2520.  
  2521. spike_x = 1700;
  2522. spike2_x = 2300;
  2523. spike3_x = 2600;
  2524. spike34_diff = 400;
  2525. spike4_x = 3000;
  2526. spike5_x = 2600;
  2527. spike56_diff = 800;
  2528. spike6_x = 3400;
  2529. spike7_x = 2600;
  2530. spike78_diff = 134;
  2531. spike8_x = 2728;
  2532. spike9_x = 2600;
  2533. spike910_diff = 128;
  2534. spike10_x = 2728;
  2535. spike1011_diff = 600;
  2536. spike11_x = 3128;
  2537. spike_y = 140;
  2538. spike_direction = 1;
  2539. random;
  2540. spike_limit = 300;
  2541. spike_difference = 40;
  2542. spike_speed = 8;
  2543. spk_dmg = 5;
  2544.  
  2545.  
  2546. sup_str[0] = '\0';
  2547. strcat(sup_str, "SS1.bmp");
  2548.  
  2549.  
  2550. sani_co = 0;
  2551. s_anim = 0;
  2552. sco = 0;
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558. gol_str[0] = '\0';
  2559. strcat(gol_str, "GT1.bmp");
  2560. gol_anim = 0;
  2561. gol_c = 0;
  2562. gco = 0;
  2563.  
  2564. go_str[0] = '\0';
  2565. strcat(go_str, "go1.bmp");
  2566. go_co = 0;
  2567. g_co = 0;
  2568.  
  2569.  
  2570.  
  2571. spikehit = 0;
  2572. spikehit2 = 0;
  2573. spikehit3 = 0;
  2574. spikehit4 = 0;
  2575. spikehit5 = 0;
  2576. spikehit6 = 0;
  2577. spikehit7 = 0;
  2578. spikehit8 = 0;
  2579. spikehit9 = 0;
  2580. spikehit10 = 0;
  2581. spikehit11 = 0;
  2582.  
  2583. obs_bl = 0;
  2584. obm_bl = 0;
  2585. obl_bl = 0;
  2586.  
  2587.  
  2588. pause_state = 0;
  2589. pause_str[0] = '\0';
  2590. strcat(pause_str, "resume1.bmp");
  2591. p_co = 0;
  2592. pauseC = 0;
  2593. pause_co = 0;
  2594. pi = 0;
  2595.  
  2596. ret_str[0] = '\0';
  2597. strcat(ret_str, "ret1.bmp");
  2598. r_co = 0;
  2599. retC = 0;
  2600. ret_co = 0;
  2601. ri = 0;
  2602.  
  2603.  
  2604. yes_st = 0;
  2605. yes_str[0] = '\0';
  2606. strcat(yes_str, "yes1.bmp");
  2607. y_co = 0;
  2608. yesC = 0;
  2609. yes_co = 0;
  2610. yi = 0;
  2611.  
  2612. no_str[0] = '\0';
  2613. strcat(no_str, "no1.bmp");
  2614. n_co = 0;
  2615. noC = 0;
  2616. no_co = 0;
  2617. ni = 0;
  2618.  
  2619.  
  2620. story_st = 0;
  2621.  
  2622. frs_co = 0;
  2623. frco = 0;
  2624. fri = 0;
  2625.  
  2626. sec_co = 0;
  2627. seco = 0;
  2628. sei = 0;
  2629.  
  2630. thr_co = 0;
  2631. thco = 0;
  2632. thi = 0;
  2633.  
  2634. for_co = 0;
  2635. foco = 0;
  2636. foi = 0;
  2637.  
  2638. fif_co = 0;
  2639. fico = 0;
  2640. fii = 0;
  2641.  
  2642. six_co = 0;
  2643. sico = 0;
  2644. sii = 0;
  2645.  
  2646. sev_co = 0;
  2647. svco = 0;
  2648. svi = 0;
  2649.  
  2650. frb = 0;
  2651. seb = 0;
  2652. thb = 0;
  2653. fob = 0;
  2654. fib = 0;
  2655. sib = 0;
  2656. svb = 0;
  2657.  
  2658. con_co = 0;
  2659. conC = 0;
  2660. con_po = 0;
  2661.  
  2662. ins_st = 0;
  2663. ins_co = 0;
  2664. inco = 0;
  2665. in_po = 0;
  2666.  
  2667. hs_st = 0;
  2668. hs_co = 0;
  2669. hco = 0;
  2670. hs_po = 0;
  2671.  
  2672.  
  2673. //middle half
  2674.  
  2675.  
  2676. cell_x = 1600;
  2677. cell_y = 300;
  2678. cell1_y = 300;
  2679. cell2_y = 525;
  2680. cell3_y = 600;
  2681.  
  2682.  
  2683. cell_speed = 20;
  2684. random_cell;
  2685.  
  2686. cell = 0;
  2687.  
  2688.  
  2689. random2_cell;
  2690. cell10_x = 10000;
  2691. cell10_y = 225;
  2692. cell11_y = 225;
  2693. cell12_y = 450;
  2694. cell13_y = 675;
  2695. cell_diff1 = 6;
  2696. cell1 = 0;
  2697.  
  2698.  
  2699. random3_cell;
  2700. cell20_x = 20000;
  2701. cell20_y = 150;
  2702. cell21_y = 150;
  2703. cell22_y = 375;
  2704.  
  2705. cell23_y = 200;
  2706. cell_diff2 = 10;
  2707.  
  2708. cell2 = 0;
  2709.  
  2710. hit = 0;
  2711. ss = 5;
  2712.  
  2713. hit1 = 0;
  2714. sd = 7;
  2715.  
  2716.  
  2717. hit2 = 0;
  2718. sd1 = 10;
  2719.  
  2720.  
  2721. randomob = 1;
  2722. obs;
  2723. obs_speed = 8;
  2724.  
  2725. obs_y = 140;
  2726. obs1_x = 1700;
  2727.  
  2728. obs2_x = 2200;
  2729. obs3_x = 3000;
  2730.  
  2731.  
  2732.  
  2733. bck_speed = 1;
  2734.  
  2735. bck_x = 128;
  2736. bck_x1 = 256;
  2737. bck_x2 = 384;
  2738. bck_x3 = 512;
  2739. bck_x4 = 640;
  2740. bck_x5 = 768;
  2741. bck_x6 = 896;
  2742. bck_x7 = 1024;
  2743. bck_x8 = 1152;
  2744. bck_x9 = 1280;
  2745. bck_x10 = 1408;
  2746.  
  2747. k = 1;
  2748. obss = 0;
  2749. obss_y = obs_y + 150;
  2750.  
  2751. obss1_y = obs_y + 326;
  2752.  
  2753. obss2_y = obs_y + 520;
  2754.  
  2755.  
  2756. over = 0;
  2757.  
  2758.  
  2759. senzu_x = 2000;
  2760. senzu_y = 200;
  2761. senzu_speed = 15;
  2762.  
  2763. random_senzu;
  2764.  
  2765.  
  2766. senzu = 1;
  2767. flag = 0;
  2768. score = 0;
  2769.  
  2770. d = 1;
  2771. ds = 0;
  2772. db_x = 2600;
  2773. db_y = 320;
  2774. db_speed = 15;
  2775. db = 0;
  2776. dr = 1;
  2777. random_db;
  2778.  
  2779.  
  2780. gol_frieza = 0;
  2781.  
  2782. frieza_x = 2100;
  2783. frieza_y = 160;
  2784. frieza_speed = 10;
  2785. f;
  2786.  
  2787.  
  2788. f_blast_x = frieza_x;
  2789. f_blast1_x = frieza_x;
  2790. f_blast = 0;
  2791. f_blast2_x = frieza_x;
  2792. f_blast1 = 0;
  2793. f_blast3_x = frieza_x;
  2794. f_blast2 = 0;
  2795. f_blast4_x = frieza_x;
  2796. f_blast3 = 0;
  2797. f_blast_y = frieza_y + 27;
  2798. f_blast1_y = frieza_y + 27;
  2799. f_blast2_y = frieza_y + 27;
  2800. f_blast3_y = frieza_y + 27;
  2801. f_blast4_y = frieza_y + 27;
  2802. f_blast_speed = 27;
  2803. f_blast4 = 0;
  2804. f_b = 0;
  2805.  
  2806. f_b1 = 0;
  2807. f_b2 = 0;
  2808. f_b3 = 0;
  2809. f_b4 = 0;
  2810. f_ap;
  2811. ff = 0;
  2812. ff1 = 0;
  2813. ff2 = 0;
  2814. ff3 = 0;
  2815. ff4 = 0;
  2816.  
  2817. fs;
  2818. fbl;
  2819.  
  2820. f_damage = 100;
  2821.  
  2822.  
  2823. dis = 10;
  2824. sco_co = 0;
  2825.  
  2826. }
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834. /*
  2835. function iDraw() is called again and again by the system.
  2836. */
  2837.  
  2838.  
  2839.  
  2840. void iDraw()
  2841. {
  2842.  
  2843. if (damage <= 0) {
  2844. go = 1;
  2845. }
  2846. if (super == 2)
  2847. {
  2848. blast_speed = 40;
  2849. jd = 27;
  2850. }
  2851. else
  2852. {
  2853. blast_speed = 25;
  2854. jd = 25;
  2855. }
  2856. if (go == 0 && pause_state >= 1 && pause_state <= 2 && !(sp_sc >= 0 && sp_sc <= 2) && !(st_sc >= 0 && st_sc <= 4))
  2857. {
  2858. if (pause_state == 1){
  2859. iClear();
  2860. iShowBMP(0, 24, pause_str);
  2861. pause_co++;
  2862. if (pause_co % 3 == 0)
  2863. {
  2864. pause_str[0] = '\0';
  2865. strcat(pause_str, "resume");
  2866. char pa[10];
  2867. strcat(pause_str, itoa((pauseC + 1), pa, 10));
  2868. strcat(pause_str, ".bmp");
  2869. if (pi % 2 == 0)
  2870. pauseC++;
  2871. else
  2872. pauseC--;
  2873. if (pauseC == 4)
  2874. pi++;
  2875. if (pauseC == 0)
  2876. pi++;
  2877. }
  2878.  
  2879. }
  2880. if (pause_state == 2){
  2881. iClear();
  2882. iShowBMP(0, 24, ret_str);
  2883. ret_co++;
  2884. if (ret_co % 3 == 0)
  2885. {
  2886. ret_str[0] = '\0';
  2887. strcat(ret_str, "ret");
  2888. char pa[10];
  2889. strcat(ret_str, itoa((retC + 1), pa, 10));
  2890. strcat(ret_str, ".bmp");
  2891. if (ri % 2 == 0)
  2892. retC++;
  2893. else
  2894. retC--;
  2895. if (retC == 4)
  2896. ri++;
  2897. if (retC == 0)
  2898. ri++;
  2899. }
  2900. }
  2901. if (res == 1){
  2902. iPauseTimer(2);
  2903. res = 0;
  2904. }
  2905. hsc_st = 0;
  2906. fr_st = 0;
  2907. }
  2908.  
  2909.  
  2910. else if (go == 0 && yes_st >= 1 && yes_st <= 2 && !(sp_sc >= 0 && sp_sc <= 2) && !(st_sc >= 0 && st_sc <= 4)){
  2911. if (yes_st == 1){
  2912. iClear();
  2913. iShowBMP(0, 24, yes_str);
  2914. yes_co++;
  2915. if (yes_co % 3 == 0)
  2916. {
  2917. yes_str[0] = '\0';
  2918. strcat(yes_str, "yes");
  2919. char pa[10];
  2920. strcat(yes_str, itoa((yesC + 1), pa, 10));
  2921. strcat(yes_str, ".bmp");
  2922. if (yi % 2 == 0)
  2923. yesC++;
  2924. else
  2925. yesC--;
  2926. if (yesC == 4)
  2927. yi++;
  2928. if (yesC == 0)
  2929. yi++;
  2930. }
  2931. }
  2932. if (yes_st == 2){
  2933. iClear();
  2934. iShowBMP(0, 24, no_str);
  2935. no_co++;
  2936. if (no_co % 3 == 0)
  2937. {
  2938. no_str[0] = '\0';
  2939. strcat(no_str, "no");
  2940. char pa[10];
  2941. strcat(no_str, itoa((noC + 1), pa, 10));
  2942. strcat(no_str, ".bmp");
  2943. if (ni % 2 == 0)
  2944. noC++;
  2945. else
  2946. noC--;
  2947. if (noC == 4)
  2948. ni++;
  2949. if (noC == 0)
  2950. ni++;
  2951. }
  2952.  
  2953. }
  2954. if (res == 1){
  2955. iPauseTimer(2);
  2956. res = 0;
  2957. }
  2958.  
  2959. }
  2960.  
  2961. else if (go == 1) {
  2962. if (sco_st == 0){
  2963. iClear();
  2964. iShowBMP(0, 24, go_str);
  2965. iShowBMP(0, 24, go_str);
  2966. go_co++;
  2967.  
  2968. if (go_co % 3 == 0)
  2969. {
  2970. go_str[0] = '\0';
  2971. strcat(go_str, "go");
  2972. char gop[10];
  2973. strcat(go_str, itoa((g_co + 1), gop, 10));
  2974. strcat(go_str, ".bmp");
  2975. if (g_co < 27)
  2976. g_co++;
  2977.  
  2978. }
  2979. if (go_co >= 120 && sco_st == 0)
  2980. sco_st = 1;
  2981. }
  2982.  
  2983.  
  2984. else if (sco_st == 1){
  2985. iShowBMP(0, 0, sco_str);
  2986. char bla[2313];
  2987. iRectangle(18, 54, 280, 30);
  2988. iText(22, 60, itoa((score), bla, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  2989. sco_co++;
  2990. if (sco_co == 20)
  2991. write();
  2992. if (sco_co % 3 == 0)
  2993. {
  2994. sco_str[0] = '\0';
  2995. strcat(sco_str, "scorepl");
  2996. char Hpr[10];
  2997. strcat(sco_str, itoa((scoC + 1), Hpr, 10));
  2998. strcat(sco_str, ".bmp");
  2999. if (sco_po % 2 == 0)
  3000. scoC++;
  3001. else
  3002. scoC--;
  3003. if (scoC == 4)
  3004. sco_po++;
  3005. if (scoC == 0)
  3006. sco_po++;
  3007. }
  3008. }
  3009. else if (sco_st == 2){
  3010. iShowBMP(0, 0, scor_str);
  3011. char bla[2313];
  3012. iRectangle(18, 54, 280, 30);
  3013. iText(22, 60, itoa((score), bla, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  3014. scor_co++;
  3015. if (scor_co % 3 == 0)
  3016. {
  3017. scor_str[0] = '\0';
  3018. strcat(scor_str, "scorert");
  3019. char Hpr[10];
  3020. strcat(scor_str, itoa((scorC + 1), Hpr, 10));
  3021. strcat(scor_str, ".bmp");
  3022. if (scor_po % 2 == 0)
  3023. scorC++;
  3024. else
  3025. scorC--;
  3026. if (scorC == 4)
  3027. scor_po++;
  3028. if (scorC == 0)
  3029. scor_po++;
  3030. }
  3031. }
  3032. if (sco_co % 20 == 0)
  3033. iSetColor(255, 0, 0);
  3034. if (sco_co % 40 == 0)
  3035. iSetColor(0, 255, 0);
  3036. if (sco_co % 60 == 0)
  3037. iSetColor(0, 0, 255);
  3038. if (sco_co % 80 == 0)
  3039. iSetColor(255, 255, 0);
  3040. if (sco_co % 100 == 0)
  3041. iSetColor(255, 0, 255);
  3042. if (sco_co % 120 == 0)
  3043. iSetColor(0, 255, 255);
  3044. if (sco_co % 140 == 0)
  3045. iSetColor(255, 255, 255);
  3046. if (res == 1){
  3047. iPauseTimer(2);
  3048. res = 0;
  3049. }
  3050.  
  3051. fr_st = 0;
  3052. }
  3053. else if (sp_sc >= 0 && sp_sc <= 2){
  3054. if (sp_sc == 0)
  3055. {
  3056. aust_co++;
  3057. iShowBMP(0, 0, au_str);
  3058. iShowBMP(0, 0, au_str);
  3059. if (aust_co % 2 == 0)
  3060. {
  3061. if (aust_po != 1)
  3062. aco++;
  3063. else{
  3064. if (aco != 1 || aub == 5)
  3065. aco--;
  3066. else
  3067. aub++;
  3068. }
  3069. au_str[0] = '\0';
  3070. strcat(au_str, "aust");
  3071. char au[10];
  3072. strcat(au_str, itoa((aco), au, 10));
  3073. strcat(au_str, ".bmp");
  3074.  
  3075. if (aco >= 11)
  3076. aust_po = 1;
  3077. if (aco <= 0){
  3078. sp_sc++;
  3079. }
  3080. }
  3081. hsc_st = 0;
  3082. fr_st = 0;
  3083. }
  3084.  
  3085. if (sp_sc == 1)
  3086. {
  3087. niloy_co++;
  3088. iShowBMP(0, 0, ni_str);
  3089. iShowBMP(0, 0, ni_str);
  3090. if (niloy_co % 2 == 0)
  3091. {
  3092. if (niloy_po != 1)
  3093. nco++;
  3094. else{
  3095. if (nco != 1 || nib == 5)
  3096. nco--;
  3097. else
  3098. nib++;
  3099. }
  3100. ni_str[0] = '\0';
  3101. strcat(ni_str, "niloy");
  3102. char au[10];
  3103. strcat(ni_str, itoa((nco), au, 10));
  3104. strcat(ni_str, ".bmp");
  3105.  
  3106. if (nco >= 11)
  3107. niloy_po = 1;
  3108. if (nco <= 0)
  3109. sp_sc++;
  3110. }
  3111. hsc_st = 0;
  3112. fr_st = 0;
  3113. }
  3114.  
  3115. if (sp_sc == 2)
  3116. {
  3117. tokey_co++;
  3118. iShowBMP(0, 0, to_str);
  3119. iShowBMP(0, 0, to_str);
  3120. if (tokey_co % 2 == 0)
  3121. {
  3122. if (tokey_po != 1)
  3123. tco++;
  3124. else{
  3125. if (tco != 1 || tob == 5)
  3126. tco--;
  3127. else
  3128. tob++;
  3129. }
  3130. to_str[0] = '\0';
  3131. strcat(to_str, "tokey");
  3132. char au[10];
  3133. strcat(to_str, itoa((tco), au, 10));
  3134. strcat(to_str, ".bmp");
  3135.  
  3136. if (tco >= 11)
  3137. tokey_po = 1;
  3138. if (tco <= 0)
  3139. sp_sc++;
  3140. }
  3141.  
  3142. }
  3143. if (res == 1){
  3144. iPauseTimer(2);
  3145. res = 0;
  3146. }
  3147. hsc_st = 0;
  3148. fr_st = 0;
  3149. }
  3150.  
  3151. else if (story_st >= 1 && story_st <= 7)
  3152. {
  3153. iClear();
  3154. if (story_st == 1)
  3155. {
  3156. frs_co++;
  3157. iShowBMP(0, 0, frs_str);
  3158. iShowBMP(0, 0, frs_str);
  3159. if (frs_co % 2 == 0)
  3160. {
  3161. if (fri != 1 && frco<11)
  3162. frco++;
  3163. else{
  3164. if (frb == 15 && frco >= 0)
  3165. frco--;
  3166. }
  3167. frs_str[0] = '\0';
  3168. strcat(frs_str, "frs");
  3169. char au[10];
  3170. strcat(frs_str, itoa((frco + 1), au, 10));
  3171. strcat(frs_str, ".bmp");
  3172.  
  3173. if (frco >= 10)
  3174. fri = 1;
  3175. if (frco <= 0 && frb == 15)
  3176. story_st++;
  3177. }
  3178. }
  3179. if (story_st == 2)
  3180. {
  3181. sec_co++;
  3182. iShowBMP(0, 0, sec_str);
  3183. iShowBMP(0, 0, sec_str);
  3184. if (sec_co % 2 == 0)
  3185. {
  3186. if (sei != 1 && seco<11)
  3187. seco++;
  3188. else{
  3189. if (seb == 15 && seco >= 0)
  3190. seco--;
  3191.  
  3192. }
  3193. sec_str[0] = '\0';
  3194. strcat(sec_str, "sec");
  3195. char au[10];
  3196. strcat(sec_str, itoa((seco + 1), au, 10));
  3197. strcat(sec_str, ".bmp");
  3198.  
  3199. if (seco >= 10)
  3200. sei = 1;
  3201. if (seco <= 0 && seb == 15)
  3202. story_st++;
  3203. }
  3204. }
  3205. if (story_st == 3)
  3206. {
  3207. thr_co++;
  3208. iShowBMP(0, 0, thr_str);
  3209. iShowBMP(0, 0, thr_str);
  3210. if (thr_co % 2 == 0)
  3211. {
  3212. if (thi != 1 && thco<11)
  3213. thco++;
  3214. else{
  3215. if (thb == 15 && thco >= 0)
  3216. thco--;
  3217.  
  3218. }
  3219. thr_str[0] = '\0';
  3220. strcat(thr_str, "thr");
  3221. char au[10];
  3222. strcat(thr_str, itoa((thco + 1), au, 10));
  3223. strcat(thr_str, ".bmp");
  3224.  
  3225. if (thco >= 10)
  3226. thi = 1;
  3227. if (thco <= 0 && thb == 15)
  3228. story_st++;
  3229. }
  3230. }
  3231. if (story_st == 4)
  3232. {
  3233. for_co++;
  3234. iShowBMP(0, 0, for_str);
  3235. iShowBMP(0, 0, for_str);
  3236. if (for_co % 2 == 0)
  3237. {
  3238. if (foi != 1 && foco<11)
  3239. foco++;
  3240. else{
  3241. if (fob == 15 && foco >= 0)
  3242. foco--;
  3243.  
  3244. }
  3245. for_str[0] = '\0';
  3246. strcat(for_str, "for");
  3247. char au[10];
  3248. strcat(for_str, itoa((foco + 1), au, 10));
  3249. strcat(for_str, ".bmp");
  3250.  
  3251. if (foco >= 10)
  3252. foi = 1;
  3253. if (foco <= 0 && fob == 15)
  3254. story_st++;
  3255. }
  3256. }
  3257. if (story_st == 5)
  3258. {
  3259. fif_co++;
  3260. iShowBMP(0, 0, fif_str);
  3261. iShowBMP(0, 0, fif_str);
  3262. if (fif_co % 2 == 0)
  3263. {
  3264. if (fii != 1 && fico<11)
  3265. fico++;
  3266. else{
  3267. if (fib == 15 && fico >= 0)
  3268. fico--;
  3269.  
  3270. }
  3271. fif_str[0] = '\0';
  3272. strcat(fif_str, "fif");
  3273. char au[10];
  3274. strcat(fif_str, itoa((fico + 1), au, 10));
  3275. strcat(fif_str, ".bmp");
  3276.  
  3277. if (fico >= 10)
  3278. fii = 1;
  3279. if (fico <= 0 && fib == 15)
  3280. story_st++;
  3281. }
  3282. }
  3283. if (story_st == 6)
  3284. {
  3285. six_co++;
  3286. iShowBMP(0, 0, six_str);
  3287. iShowBMP(0, 0, six_str);
  3288. if (six_co % 2 == 0)
  3289. {
  3290. if (sii != 1 && sico<11)
  3291. sico++;
  3292. else{
  3293. if (sib == 15 && sico>0)
  3294. sico--;
  3295.  
  3296. }
  3297. six_str[0] = '\0';
  3298. strcat(six_str, "six");
  3299. char au[10];
  3300. strcat(six_str, itoa((sico + 1), au, 10));
  3301. strcat(six_str, ".bmp");
  3302.  
  3303. if (sico >= 10)
  3304. sii = 1;
  3305. if (sico <= 0 && sib == 15)
  3306. story_st++;
  3307. }
  3308. }
  3309. if (story_st == 7)
  3310. {
  3311. sev_co++;
  3312. iShowBMP(0, 0, sev_str);
  3313. iShowBMP(0, 0, sev_str);
  3314. iShowBMP(0, 0, sev_str);
  3315. if (sev_co % 2 == 0)
  3316. {
  3317. if (svi != 1 && sco<11)
  3318. svco++;
  3319. else{
  3320. if (svb == 15 && svco >= 0)
  3321. svco--;
  3322. else
  3323. svb++;
  3324. }
  3325. sev_str[0] = '\0';
  3326. strcat(sev_str, "sev");
  3327. char au[10];
  3328. strcat(sev_str, itoa((svco + 1), au, 10));
  3329. strcat(sev_str, ".bmp");
  3330.  
  3331. if (svco >= 10)
  3332. svi = 1;
  3333. if (svco <= 0 && svb == 15)
  3334. {
  3335. story_st++;
  3336. }
  3337. }
  3338. if (res == 1){
  3339. iPauseTimer(2);
  3340. res = 0;
  3341. }
  3342. hsc_st = 0;
  3343. fr_st = 0;
  3344. }
  3345. if (story_st != 7 && (frco == 10 || seco == 10 || thco == 10 || foco == 10 || fico == 10 | sico == 10 || svco == 10)){
  3346. iShowBMPWOBGWP(880, 15, con_str, 0);
  3347. con_co++;
  3348. if (con_co % 2 == 0)
  3349. {
  3350. con_str[0] = '\0';
  3351. strcat(con_str, "cont");
  3352. char lopr[10];
  3353. strcat(con_str, itoa((conC + 1), lopr, 10));
  3354. strcat(con_str, ".bmp");
  3355. if (con_po % 2 == 0)
  3356. conC++;
  3357. else
  3358. conC--;
  3359. if (conC == 5)
  3360. con_po++;
  3361. if (conC == 0)
  3362. con_po++;
  3363. }
  3364.  
  3365. iShowBMPWOBGWP(44, 15, ski_str, 0);
  3366. ski_co++;
  3367. if (ski_co % 2 == 0)
  3368. {
  3369. ski_str[0] = '\0';
  3370. strcat(ski_str, "skip");
  3371. char lopr[10];
  3372. strcat(ski_str, itoa((skiC + 1), lopr, 10));
  3373. strcat(ski_str, ".bmp");
  3374. if (ski_po % 2 == 0)
  3375. skiC++;
  3376. else
  3377. skiC--;
  3378. if (skiC == 5)
  3379. ski_po++;
  3380. if (skiC == 0)
  3381. ski_po++;
  3382. }
  3383. }
  3384. if (res == 1){
  3385. iPauseTimer(2);
  3386. res = 0;
  3387. }
  3388. hsc_st = 0;
  3389. fr_st = 0;
  3390. }
  3391. else if (load_st == 1)
  3392. {
  3393. iClear();
  3394. if (load_bar <= 200)
  3395. iShowBMP(0, 0, "load1.bmp");
  3396. else if (load_bar <= 400)
  3397. iShowBMP(0, 0, "load2.bmp");
  3398. else if (load_bar <= 600)
  3399. iShowBMP(0, 0, "load3.bmp");
  3400. else if (load_bar <= 800)
  3401. iShowBMP(0, 0, "load4.bmp");
  3402. else if (load_bar <= 1000)
  3403. iShowBMP(0, 0, "load5.bmp");
  3404.  
  3405.  
  3406. iShowBMPWOBGWP(480, 110, lo_str, 0);
  3407. lo_co++;
  3408. if (lo_co % 3 == 0)
  3409. {
  3410. lo_str[0] = '\0';
  3411. strcat(lo_str, "lo");
  3412. char lopr[10];
  3413. strcat(lo_str, itoa((lco + 1), lopr, 10));
  3414. strcat(lo_str, ".bmp");
  3415. if (lo_po % 2 == 0)
  3416. lco++;
  3417. else
  3418. lco--;
  3419. if (lco == 4)
  3420. lo_po++;
  3421. if (lco == 0)
  3422. lo_po++;
  3423. }
  3424. iSetColor(255, 255, 255);
  3425. iRectangle(70, 100, 1140, 30);
  3426. iSetColor(25, 135, 255);
  3427. iFilledRectangle(75, 105, load_bar*1.130, 20);
  3428.  
  3429. load_bar += 5;
  3430. if (load_bar > 1000)
  3431. {
  3432. load_st = 3;
  3433. story_st = 1;
  3434. }
  3435. if (res == 1){
  3436. iPauseTimer(2);
  3437. res = 0;
  3438. }
  3439. hsc_st = 0;
  3440. fr_st = 0;
  3441. }
  3442. else if (st_sc >= 0 && st_sc <= 4){
  3443. if (st_sc == 0){
  3444. iClear();
  3445. iShowBMP(0, 24, pr_str);
  3446. press_co++;
  3447. if (press_co % 3 == 0)
  3448. {
  3449. pr_str[0] = '\0';
  3450. strcat(pr_str, "N");
  3451. char pr[10];
  3452. strcat(pr_str, itoa((prc + 1), pr, 10));
  3453. strcat(pr_str, ".bmp");
  3454. if (pri % 2 == 0)
  3455. prc++;
  3456. else
  3457. prc--;
  3458. if (prc == 4)
  3459. pri++;
  3460. if (prc == 0)
  3461. pri++;
  3462.  
  3463. }
  3464. hsc_st = 0;
  3465. fr_st = 0;
  3466. }
  3467. else if (st_sc == 1)
  3468. {
  3469. iClear();
  3470. iShowBMP(0, 24, S_str);
  3471. press_co++;
  3472. if (press_co % 3 == 0)
  3473. {
  3474. S_str[0] = '\0';
  3475. strcat(S_str, "S");
  3476. char Spr[10];
  3477. strcat(S_str, itoa((Sc + 1), Spr, 10));
  3478. strcat(S_str, ".bmp");
  3479. if (Si % 2 == 0)
  3480. Sc++;
  3481. else
  3482. Sc--;
  3483. if (Sc == 4)
  3484. Si++;
  3485. if (Sc == 0)
  3486. Si++;
  3487. }
  3488. hsc_st = 0;
  3489. fr_st = 0;
  3490. }
  3491.  
  3492. else if (st_sc == 2)
  3493. {
  3494. iClear();
  3495. iShowBMP(0, 24, I_str);
  3496. press_co++;
  3497. if (press_co % 3 == 0)
  3498. {
  3499. I_str[0] = '\0';
  3500. strcat(I_str, "I");
  3501. char Ipr[10];
  3502. strcat(I_str, itoa((Ic + 1), Ipr, 10));
  3503. strcat(I_str, ".bmp");
  3504. if (Ii % 2 == 0)
  3505. Ic++;
  3506. else
  3507. Ic--;
  3508. if (Ic == 4)
  3509. Ii++;
  3510. if (Ic == 0)
  3511. Ii++;
  3512. }
  3513. hsc_st = 0;
  3514. fr_st = 0;
  3515. }
  3516. else if (st_sc == 3)
  3517. {
  3518. iClear();
  3519. iShowBMP(0, 24, H_str);
  3520. press_co++;
  3521. if (press_co % 3 == 0)
  3522. {
  3523. H_str[0] = '\0';
  3524. strcat(H_str, "H");
  3525. char Hpr[10];
  3526. strcat(H_str, itoa((Hc + 1), Hpr, 10));
  3527. strcat(H_str, ".bmp");
  3528. if (Hi % 2 == 0)
  3529. Hc++;
  3530. else
  3531. Hc--;
  3532. if (Hc == 4)
  3533. Hi++;
  3534. if (Hc == 0)
  3535. Hi++;
  3536. }
  3537. hsc_st = 0;
  3538. fr_st = 0;
  3539. }
  3540. else if (st_sc == 4)
  3541. {
  3542. iClear();
  3543. iShowBMP(0, 24, Q_str);
  3544. press_co++;
  3545. if (press_co % 3 == 0)
  3546. {
  3547. Q_str[0] = '\0';
  3548. strcat(Q_str, "Q");
  3549. char Qpr[10];
  3550. strcat(Q_str, itoa((Qc + 1), Qpr, 10));
  3551. strcat(Q_str, ".bmp");
  3552. if (Qi % 2 == 0)
  3553. Qc++;
  3554. else
  3555. Qc--;
  3556. if (Qc == 4)
  3557. Qi++;
  3558. if (Qc == 0)
  3559. Qi++;
  3560. }
  3561. }
  3562. if (res == 1){
  3563. iPauseTimer(2);
  3564. res = 0;
  3565. }
  3566. hsc_st = 0;
  3567. fr_st = 0;
  3568. }
  3569. else if (ins_st == 1)
  3570. {
  3571. iClear();
  3572. iShowBMP(0, 0, in_str);
  3573. ins_co++;
  3574. if (ins_co % 3 == 0)
  3575. {
  3576. in_str[0] = '\0';
  3577. strcat(in_str, "ins");
  3578. char lopr[10];
  3579. strcat(in_str, itoa((inco + 1), lopr, 10));
  3580. strcat(in_str, ".bmp");
  3581. if (in_po % 2 == 0)
  3582. inco++;
  3583. else
  3584. inco--;
  3585. if (inco == 5)
  3586. in_po++;
  3587. if (inco == 0)
  3588. in_po++;
  3589. }
  3590. if (res == 1){
  3591. iPauseTimer(2);
  3592. res = 0;
  3593. }
  3594. hsc_st = 0;
  3595. fr_st = 0;
  3596. }
  3597. else if (hs_st == 1)
  3598. {
  3599. iClear();
  3600. hsc_st = 1;
  3601. iShowBMP(0, 0, hs_str);
  3602. hs_co++;
  3603. if (hs_co % 3 == 0)
  3604. {
  3605. hs_str[0] = '\0';
  3606. strcat(hs_str, "popo");
  3607. char lopr[10];
  3608. strcat(hs_str, itoa((hco + 1), lopr, 10));
  3609. strcat(hs_str, ".bmp");
  3610. if (hs_po % 2 == 0)
  3611. hco++;
  3612. else
  3613. hco--;
  3614. if (hco == 5)
  3615. hs_po++;
  3616. if (hco == 0)
  3617. hs_po++;
  3618. }
  3619. if (res == 1){
  3620. iPauseTimer(2);
  3621. res = 0;
  3622. }
  3623. }
  3624.  
  3625. else if (super == 2 && s_anim == 1 && !(st_sc >= 0 && st_sc <= 4)){
  3626. iClear();
  3627. iShowBMP(0, 24, sup_str);
  3628. iShowBMP(0, 24, sup_str);
  3629. sani_co++;
  3630.  
  3631. if (sani_co % 2 == 0)
  3632. {
  3633. sup_str[0] = '\0';
  3634. strcat(sup_str, "SS");
  3635. char sup[10];
  3636. strcat(sup_str, itoa((sco + 1), sup, 10));
  3637. strcat(sup_str, ".bmp");
  3638. sco++;
  3639. if (sco >= 147)
  3640. s_anim = 3;
  3641. }
  3642. if (res == 1){
  3643. iPauseTimer(2);
  3644. res = 0;
  3645. }
  3646. hsc_st = 0;
  3647. fr_st = 0;
  3648. }
  3649. else if (gol_anim == 1)
  3650. {
  3651. iClear();
  3652. iShowBMP(0, 24, gol_str);
  3653. iShowBMP(0, 24, gol_str);
  3654. iShowBMP(0, 24, gol_str);
  3655. gol_c++;
  3656.  
  3657. if (gol_c % 2 == 0)
  3658. {
  3659. gol_str[0] = '\0';
  3660. strcat(gol_str, "GT");
  3661. char gol[10];
  3662. strcat(gol_str, itoa((gco + 1), gol, 10));
  3663. strcat(gol_str, ".bmp");
  3664. gco++;
  3665. if (gco >= 178)
  3666. gol_anim = 3;
  3667. }
  3668. if (res == 1){
  3669. iPauseTimer(2);
  3670. res = 0;
  3671. }
  3672. hsc_st = 0;
  3673. fr_st = 0;
  3674. }
  3675.  
  3676.  
  3677. else if (go == 0)
  3678. {
  3679. iClear();
  3680. if (res == 0){
  3681. iResumeTimer(2);
  3682. res = 1;
  3683. }
  3684.  
  3685. hsc_st = 0;
  3686. fr_st = 0;
  3687.  
  3688. iShowBMP(bck_x, ground_y, "bck1.bmp");
  3689. iShowBMP(bck_x1, ground_y, "bck2.bmp");
  3690. iShowBMP(bck_x2, ground_y, "bck3.bmp");
  3691. iShowBMP(bck_x3, ground_y, "bck4.bmp");
  3692. iShowBMP(bck_x4, ground_y, "bck5.bmp");
  3693. iShowBMP(bck_x5, ground_y, "bck6.bmp");
  3694. iShowBMP(bck_x6, ground_y, "bck7.bmp");
  3695. iShowBMP(bck_x7, ground_y, "bck8.bmp");
  3696. iShowBMP(bck_x8, ground_y, "bck9.bmp");
  3697. iShowBMP(bck_x9, ground_y, "bck10.bmp");
  3698. iShowBMP(bck_x10, ground_y, "bck11.bmp");
  3699.  
  3700. iShowBMP(0, 0, "bck1.bmp");
  3701.  
  3702.  
  3703. iShowBMPWOBGWP(ground_x, ground_y, "gr1.bmp", 0);
  3704. iShowBMPWOBGWP(ground_x1, ground_y, "gr2.bmp", 0);
  3705. iShowBMPWOBGWP(ground_x2, ground_y, "gr3.bmp", 0);
  3706. iShowBMPWOBGWP(ground_x3, ground_y, "gr4.bmp", 0);
  3707. iShowBMPWOBGWP(ground_x4, ground_y, "gr5.bmp", 0);
  3708. iShowBMPWOBGWP(ground_x5, ground_y, "gr6.bmp", 0);
  3709. iShowBMPWOBGWP(ground_x6, ground_y, "gr7.bmp", 0);
  3710. iShowBMPWOBGWP(ground_x7, ground_y, "gr8.bmp", 0);
  3711. iShowBMPWOBGWP(ground_x8, ground_y, "gr9.bmp", 0);
  3712. iShowBMPWOBGWP(ground_x9, ground_y, "gr10.bmp", 0);
  3713. if (obs == 1) {
  3714. if (obs_bl == 0)
  3715. iShowBMPWOBGWP(obs1_x, obs_y, "obs.bmp", 0);
  3716. else if (obs_bl == 1)
  3717. iShowBMPWOBGWP(obs1_x, obs_y, "obs1.bmp", 0);
  3718. else if (obs_bl == 2)
  3719. iShowBMPWOBGWP(obs1_x, obs_y, "obs2.bmp", 0);
  3720. else if (obs_bl == 3)
  3721. iShowBMPWOBGWP(obs1_x, obs_y, "obs3.bmp", 0);
  3722. }
  3723. else if (obs == 2) {
  3724. if (obm_bl == 0)
  3725. iShowBMPWOBGWP(obs2_x, obs_y, "obm.bmp", 0);
  3726. else if (obm_bl == 1)
  3727. iShowBMPWOBGWP(obs2_x, obs_y, "obm1.bmp", 0);
  3728. else if (obm_bl == 2)
  3729. iShowBMPWOBGWP(obs2_x, obs_y, "obm2.bmp", 0);
  3730. else if (obm_bl == 3)
  3731. iShowBMPWOBGWP(obs2_x, obs_y, "obm3.bmp", 0);
  3732. else if (obm_bl == 4)
  3733. iShowBMPWOBGWP(obs2_x, obs_y, "obm4.bmp", 0);
  3734. else if (obm_bl == 5)
  3735. iShowBMPWOBGWP(obs2_x, obs_y, "obm5.bmp", 0);
  3736. }
  3737. else if (obs == 3) {
  3738. if (obl_bl == 0)
  3739. iShowBMPWOBGWP(obs3_x, obs_y, "obl.bmp", 0);
  3740. else if (obl_bl == 1)
  3741. iShowBMPWOBGWP(obs3_x, obs_y, "obl1.bmp", 0);
  3742. else if (obl_bl == 2)
  3743. iShowBMPWOBGWP(obs3_x, obs_y, "obl2.bmp", 0);
  3744. else if (obl_bl == 3)
  3745. iShowBMPWOBGWP(obs3_x, obs_y, "obl3.bmp", 0);
  3746. else if (obl_bl == 4)
  3747. iShowBMPWOBGWP(obs3_x, obs_y, "obl4.bmp", 0);
  3748. else if (obl_bl == 5)
  3749. iShowBMPWOBGWP(obs3_x, obs_y, "obl5.bmp", 0);
  3750. else if (obl_bl == 6)
  3751. iShowBMPWOBGWP(obs3_x, obs_y, "obl6.bmp", 0);
  3752. else if (obl_bl == 7)
  3753. iShowBMPWOBGWP(obs3_x, obs_y, "obl7.bmp", 0);
  3754. }
  3755. if (gol_frieza == 0) {
  3756. if (f_ap == 1)
  3757. iShowBMPWOBG(frieza_x, frieza_y, "fb1.bmp");
  3758.  
  3759. else if (f_ap == 2)
  3760. iShowBMPWOBG(frieza_x, frieza_y, "fb2.bmp");
  3761. else if (f_ap != 1 && f_ap != 2){
  3762. iShowBMPWOBG(frieza_x, frieza_y, "frieza.bmp");
  3763. }
  3764. }
  3765. else if (gol_frieza == 1) {
  3766. cell_speed = 30;
  3767. f_blast_speed = 50;
  3768. if (f_ap == 3){
  3769. iShowBMPWOBG(frieza_x, frieza_y, "gf1.bmp");
  3770. }
  3771. else if (f_ap == 1) {
  3772. iShowBMPWOBG(frieza_x, frieza_y, "gf2.bmp");
  3773. }
  3774. else if (f_ap == 4) {
  3775. iShowBMPWOBG(frieza_x, frieza_y, "gf1.bmp");
  3776. }
  3777. else if (f_ap == 2) {
  3778. iShowBMPWOBG(frieza_x, frieza_y, "gf2.bmp");
  3779. }
  3780. else if (f_ap != 1 && f_ap != 2){
  3781. iShowBMPWOBG(frieza_x, frieza_y, "g_frieza.bmp");
  3782. }
  3783. }
  3784.  
  3785.  
  3786. if (gol_frieza == 0) {
  3787. iShowBMPWOBGWP(f_blast_x, f_blast_y, "rf_Blast.bmp", 0);
  3788. iShowBMPWOBGWP(f_blast1_x, f_blast1_y, "rf_Blast.bmp", 0);
  3789. iShowBMPWOBGWP(f_blast2_x, f_blast2_y, "rf_Blast.bmp", 0);
  3790. iShowBMPWOBGWP(f_blast3_x, f_blast3_y, "rf_Blast.bmp", 0);
  3791. iShowBMPWOBGWP(f_blast4_x, f_blast4_y, "rf_Blast.bmp", 0);
  3792. }
  3793. else if (gol_frieza == 1) {
  3794. iShowBMPWOBG(f_blast_x, f_blast_y - 4, "gf_blast.bmp");
  3795. iShowBMPWOBG(f_blast1_x, f_blast1_y - 4, "gf_blast.bmp");
  3796. iShowBMPWOBG(f_blast2_x, f_blast2_y - 4, "gf_blast.bmp");
  3797. iShowBMPWOBG(f_blast3_x, f_blast3_y - 4, "gf_blast.bmp");
  3798. iShowBMPWOBG(f_blast4_x, f_blast4_y - 4, "gf_blast.bmp");
  3799. }
  3800.  
  3801.  
  3802. if (d = 1 && ds == 0) {
  3803. if (db == 0) {
  3804. iShowBMPWOBGWP(db_x, db_y, "db1.bmp", 0);
  3805. }
  3806. else if (db == 1) {
  3807. iShowBMPWOBGWP(db_x, db_y, "db2.bmp", 0);
  3808. }
  3809. else if (db == 2) {
  3810. iShowBMPWOBGWP(db_x, db_y, "db3.bmp", 0);
  3811. }
  3812. else if (db == 3) {
  3813. iShowBMPWOBGWP(db_x, db_y, "db4.bmp", 0);
  3814. }
  3815. else if (db == 4) {
  3816. iShowBMPWOBGWP(db_x, db_y, "db5.bmp", 0);
  3817. }
  3818. else if (db == 5) {
  3819. iShowBMPWOBGWP(db_x, db_y, "db6.bmp", 0);
  3820. }
  3821. else if (db == 6) {
  3822. iShowBMPWOBGWP(db_x, db_y, "db7.bmp", 0);
  3823. }
  3824. }
  3825.  
  3826.  
  3827.  
  3828. if (super == 1) {
  3829. if (jumping == 0 && gr != 1 && gr1 != 1 && gr2 != 1 && gr3 != 1 && gr4 != 1 && gr5 != 1 && gr6 != 1){
  3830. if (run == 0) {
  3831. iShowBMPWOBG(goku_x, jump_y, "r1.bmp");
  3832. }
  3833. else if (run == 1) {
  3834. iShowBMPWOBG(goku_x, jump_y, "r2.bmp");
  3835. }
  3836. else if (run == 2) {
  3837. iShowBMPWOBG(goku_x, jump_y, "r3.bmp");
  3838. }
  3839. else if (run == 3) {
  3840. iShowBMPWOBG(goku_x, jump_y, "r4.bmp");
  3841. }
  3842. else if (run == 4) {
  3843. iShowBMPWOBG(goku_x, jump_y, "r5.bmp");
  3844. }
  3845. else if (run == 5) {
  3846. iShowBMPWOBG(goku_x, jump_y, "r6.bmp");
  3847. }
  3848. else if (run == 6) {
  3849. iShowBMPWOBG(goku_x, jump_y, "r7.bmp");
  3850. }
  3851. else if (run == 7) {
  3852. iShowBMPWOBG(goku_x, jump_y, "r8.bmp");
  3853. }
  3854. }
  3855. if (k == 0) {
  3856. if (run == 0) {
  3857. iShowBMPWOBG(goku_x, jump_y, "r1.bmp");
  3858. }
  3859. else if (run == 1) {
  3860. iShowBMPWOBG(goku_x, jump_y, "r2.bmp");
  3861. }
  3862. else if (run == 2) {
  3863. iShowBMPWOBG(goku_x, jump_y, "r3.bmp");
  3864. }
  3865. else if (run == 3) {
  3866. iShowBMPWOBG(goku_x, jump_y, "r4.bmp");
  3867. }
  3868. else if (run == 4) {
  3869. iShowBMPWOBG(goku_x, jump_y, "r5.bmp");
  3870. }
  3871. else if (run == 5) {
  3872. iShowBMPWOBG(goku_x, jump_y, "r6.bmp");
  3873. }
  3874. else if (run == 6) {
  3875. iShowBMPWOBG(goku_x, jump_y, "r7.bmp");
  3876. }
  3877. else if (run == 7) {
  3878. iShowBMPWOBG(goku_x, jump_y, "r8.bmp");
  3879. }
  3880.  
  3881. }
  3882. }
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888. if (super == 2) {
  3889. if (damage >= 850){
  3890. if (run == 0)
  3891. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3892. else if (run == 1)
  3893. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3894. else if (run == 2)
  3895. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3896. else if (run == 3)
  3897. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3898. else if (run == 4)
  3899. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3900. else if (run == 5)
  3901. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3902. else if (run == 6)
  3903. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3904. else if (run == 7)
  3905. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3906. }
  3907. else if (damage >= 680){
  3908. if (run == 0)
  3909. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3910. else if (run == 2)
  3911. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3912. else if (run == 3)
  3913. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3914. else if (run == 4)
  3915. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3916. else if (run == 6)
  3917. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3918. else if (run == 7)
  3919. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3920. }
  3921. else if (damage >= 430){
  3922. if (run == 0)
  3923. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3924. else if (run == 2)
  3925. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3926. else if (run == 4)
  3927. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3928. else if (run == 6)
  3929. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3930. }
  3931. else if (damage >= 300){
  3932. if (run == 0)
  3933. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3934. else if (run == 4)
  3935. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3936. }
  3937. else if (damage >= 110){
  3938. if (run == 0)
  3939. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3940. }
  3941.  
  3942.  
  3943. if (k == 0) {
  3944. if (damage >= 850){
  3945. if (run == 0)
  3946. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3947. else if (run == 1)
  3948. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3949. else if (run == 2)
  3950. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3951. else if (run == 3)
  3952. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3953. else if (run == 4)
  3954. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3955. else if (run == 5)
  3956. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3957. else if (run == 6)
  3958. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3959. else if (run == 7)
  3960. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3961. }
  3962. else if (damage >= 680){
  3963. if (run == 0)
  3964. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3965. else if (run == 2)
  3966. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3967. else if (run == 3)
  3968. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3969. else if (run == 4)
  3970. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3971. else if (run == 6)
  3972. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3973. else if (run == 7)
  3974. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3975. }
  3976. else if (damage >= 430){
  3977. if (run == 0)
  3978. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3979. else if (run == 2)
  3980. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3981. else if (run == 4)
  3982. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura3.bmp", 0);
  3983. else if (run == 6)
  3984. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura4.bmp", 0);
  3985. }
  3986. else if (damage >= 300){
  3987. if (run == 0)
  3988. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3989. else if (run == 4)
  3990. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura2.bmp", 0);
  3991. }
  3992. else if (damage >= 110){
  3993. if (run == 0)
  3994. iShowBMPWOBGWP(goku_x - 34, jump_y - 10, "aura1.bmp", 0);
  3995. }
  3996. if (run == 0) {
  3997. iShowBMPWOBG(goku_x, jump_y, "sr1.bmp");
  3998. }
  3999. else if (run == 1) {
  4000. iShowBMPWOBG(goku_x, jump_y, "sr2.bmp");
  4001. }
  4002. else if (run == 2) {
  4003. iShowBMPWOBG(goku_x, jump_y, "sr3.bmp");
  4004. }
  4005. else if (run == 3) {
  4006. iShowBMPWOBG(goku_x, jump_y, "sr4.bmp");
  4007. }
  4008. else if (run == 4) {
  4009. iShowBMPWOBG(goku_x, jump_y, "sr5.bmp");
  4010. }
  4011. else if (run == 5) {
  4012. iShowBMPWOBG(goku_x, jump_y, "sr6.bmp");
  4013. }
  4014. else if (run == 6) {
  4015. iShowBMPWOBG(goku_x, jump_y, "sr7.bmp");
  4016. }
  4017. else if (run == 7) {
  4018. iShowBMPWOBG(goku_x, jump_y, "sr8.bmp");
  4019. }
  4020.  
  4021. }
  4022.  
  4023.  
  4024.  
  4025. if (jumping == 0 && gr != 1 && gr1 != 1 && gr2 != 1 && gr3 != 1 && gr4 != 1 && gr5 != 1 && gr6 != 1){
  4026.  
  4027. if (run == 0) {
  4028. iShowBMPWOBG(goku_x, jump_y, "sr1.bmp");
  4029. }
  4030. else if (run == 1) {
  4031. iShowBMPWOBG(goku_x, jump_y, "sr2.bmp");
  4032. }
  4033. else if (run == 2) {
  4034. iShowBMPWOBG(goku_x, jump_y, "sr3.bmp");
  4035. }
  4036. else if (run == 3) {
  4037. iShowBMPWOBG(goku_x, jump_y, "sr4.bmp");
  4038. }
  4039. else if (run == 4) {
  4040. iShowBMPWOBG(goku_x, jump_y, "sr5.bmp");
  4041. }
  4042. else if (run == 5) {
  4043. iShowBMPWOBG(goku_x, jump_y, "sr6.bmp");
  4044. }
  4045. else if (run == 6) {
  4046. iShowBMPWOBG(goku_x, jump_y, "sr7.bmp");
  4047. }
  4048. else if (run == 7) {
  4049. iShowBMPWOBG(goku_x, jump_y, "sr8.bmp");
  4050. }
  4051. }
  4052. }
  4053.  
  4054.  
  4055.  
  4056. //jump
  4057. if (k == 1 && super == 1) {
  4058. if (jumping == 1) {
  4059. if (jump == 0){
  4060. iShowBMPWOBG(goku_x, jump_y, "j2.bmp");
  4061. }
  4062. else if (jump == 1) {
  4063. iShowBMPWOBG(goku_x, jump_y, "j3.bmp");
  4064. }
  4065. else if (jump == 2) {
  4066. iShowBMPWOBG(goku_x, jump_y, "j3.bmp");
  4067. }
  4068. }
  4069. else if (jumping == 2) {
  4070. if (jump == 0){
  4071. iShowBMPWOBG(goku_x, jump_y, "j5.bmp");
  4072. }
  4073. else if (jump == 1) {
  4074. iShowBMPWOBG(goku_x, jump_y, "j6.bmp");
  4075. }
  4076. else if (jump == 2) {
  4077. iShowBMPWOBG(goku_x, jump_y, "j8.bmp");
  4078. }
  4079. }
  4080. }
  4081.  
  4082.  
  4083.  
  4084. if (super == 2 && k == 1) {
  4085. if (jumping == 1) {
  4086. if (jump == 0){
  4087. iShowBMPWOBG(goku_x, jump_y, "sj2.bmp");
  4088. }
  4089. else if (jump == 1) {
  4090. iShowBMPWOBG(goku_x, jump_y, "sj3.bmp");
  4091. }
  4092. else if (jump == 2) {
  4093. iShowBMPWOBG(goku_x, jump_y, "sj3.bmp");
  4094. }
  4095. }
  4096. else if (jumping == 2) {
  4097. if (jump == 0){
  4098. iShowBMPWOBG(goku_x, jump_y, "sj5.bmp");
  4099. }
  4100. else if (jump == 1) {
  4101. iShowBMPWOBG(goku_x, jump_y, "sj6.bmp");
  4102. }
  4103. else if (jump == 2) {
  4104. iShowBMPWOBG(goku_x, jump_y, "sj8.bmp");
  4105. }
  4106. }
  4107. }
  4108.  
  4109.  
  4110. //Blast
  4111. if (super == 1){
  4112. if (blast_button != 0 && blast_button != 3)
  4113. {
  4114. gr = 1;
  4115. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4116. }
  4117. else
  4118. gr = 0;
  4119. if (blast > 5 && blast_button != 0)
  4120. {
  4121. if (blast_x < 350)
  4122. {
  4123. gr = 1;
  4124. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4125.  
  4126. }
  4127. else
  4128. gr = 0;
  4129. blast_button = 3;
  4130. if (blast_flag == 0)
  4131. {
  4132. blast_y = jump_y + 27;
  4133. blast_flag = 1;
  4134. }
  4135.  
  4136. iShowBMPWOBG(blast_x, blast_y, "blast.bmp");
  4137. if (blast_x >= 1280)
  4138. {
  4139. blast_x = 240;
  4140. blast_button = 0;
  4141. blast_flag = 0;
  4142. blast_y = 0;
  4143. }
  4144. }
  4145.  
  4146. //Blast1
  4147. if (blast1_button != 0 && blast1_button != 3)
  4148. {
  4149. gr1 = 1;
  4150. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4151. }
  4152. else
  4153. gr1 = 0;
  4154. if (blast1 > 5 && blast1_button != 0)
  4155. {
  4156. if (blast1_x < 350)
  4157. {
  4158. gr1 = 1;
  4159. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4160.  
  4161. }
  4162. else
  4163. gr1 = 0;
  4164. blast1_button = 3;
  4165. if (blast1_flag == 0)
  4166. {
  4167. blast1_y = jump_y + 27;
  4168. blast1_flag = 1;
  4169. }
  4170. iShowBMPWOBG(blast1_x, blast1_y, "blast.bmp");
  4171. if (blast1_x >= 1280)
  4172. {
  4173. blast1_x = 240;
  4174. blast1_button = 0;
  4175. blast1_flag = 0;
  4176. blast1_y = 0;
  4177. }
  4178. }
  4179.  
  4180. //Blast2
  4181.  
  4182. if (blast2_button != 0 && blast2_button != 3)
  4183. {
  4184. gr2 = 1;
  4185. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4186. }
  4187. else
  4188. gr2 = 0;
  4189. if (blast2 > 5, k, k && blast2_button != 0)
  4190. {
  4191. if (blast2_x < 350)
  4192. {
  4193. gr2 = 1;
  4194. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4195.  
  4196. }
  4197. else
  4198. gr2 = 0;
  4199. blast2_button = 3;
  4200. if (blast2_flag == 0)
  4201. {
  4202. blast2_y = jump_y + 27;
  4203. blast2_flag = 1;
  4204. }
  4205.  
  4206. iShowBMPWOBG(blast2_x, blast2_y, "blast.bmp");
  4207. if (blast2_x >= 1280)
  4208. {
  4209. blast2_x = 240;
  4210. blast2_button = 0;
  4211. blast2_flag = 0;
  4212. blast2_y = 0;
  4213. }
  4214. }
  4215.  
  4216. //Blast3
  4217. if (blast3_button != 0 && blast3_button != 3)
  4218. {
  4219. gr3 = 1;
  4220. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4221. }
  4222. else
  4223. gr3 = 0;
  4224. if (blast3 > 5 && blast3_button != 0)
  4225. {
  4226. if (blast3_x < 350)
  4227. {
  4228. gr3 = 1;
  4229. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4230.  
  4231. }
  4232. else
  4233. gr3 = 0;
  4234. blast3_button = 3;
  4235. if (blast3_flag == 0)
  4236. {
  4237. blast3_y = jump_y + 27;
  4238. blast3_flag = 1;
  4239. }
  4240.  
  4241. iShowBMPWOBG(blast3_x, blast3_y, "blast.bmp");
  4242. if (blast3_x >= 1280)
  4243. {
  4244. blast3_x = 240;
  4245. blast3_button = 0;
  4246. blast3_flag = 0;
  4247. blast3_y = 0;
  4248. }
  4249. }
  4250.  
  4251.  
  4252. //Blast4
  4253.  
  4254. if (blast4_button != 0 && blast4_button != 3)
  4255. {
  4256. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4257. gr4 = 1;
  4258. }
  4259. else
  4260. gr4 = 0;
  4261. if (blast4 > 5 && blast4_button != 0)
  4262. {
  4263. if (blast4_x < 350)
  4264. {
  4265. gr4 = 1;
  4266. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4267.  
  4268. }
  4269. else
  4270. gr4 = 0;
  4271. blast4_button = 3;
  4272. if (blast4_flag == 0)
  4273. {
  4274. blast4_y = jump_y + 27;
  4275. blast4_flag = 1;
  4276. }
  4277.  
  4278. iShowBMPWOBG(blast4_x, blast4_y, "blast.bmp");
  4279. if (blast4_x >= 1280)
  4280. {
  4281. blast4_x = 240;
  4282. blast4_button = 0;
  4283. blast4_flag = 0;
  4284. blast4_y = 0;
  4285. }
  4286. }
  4287.  
  4288.  
  4289. //Blast5
  4290.  
  4291. if (blast5_button != 0 && blast5_button != 3)
  4292. {
  4293. gr5 = 1;
  4294. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4295. }
  4296. else
  4297. gr5 = 0;
  4298. if (blast5 > 5 && blast5_button != 0)
  4299. {
  4300. if (blast5_x < 350)
  4301. {
  4302. gr5 = 1;
  4303. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4304.  
  4305. }
  4306. else
  4307. gr5 = 0;
  4308. blast5_button = 3;
  4309. if (blast5_flag == 0)
  4310. {
  4311. blast5_y = jump_y + 27;
  4312. blast5_flag = 1;
  4313. }
  4314.  
  4315. iShowBMPWOBG(blast5_x, blast5_y, "blast.bmp");
  4316. if (blast5_x >= 1280)
  4317. {
  4318. blast5_x = 240;
  4319. blast5_button = 0;
  4320. blast5_flag = 0;
  4321. blast5_y = 0;
  4322. }
  4323. }
  4324.  
  4325.  
  4326. //Blast6
  4327.  
  4328. if (blast6_button != 0 && blast6_button != 3)
  4329. {
  4330. gr6 = 1;
  4331. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4332. }
  4333. else
  4334. gr6 = 0;
  4335. if (blast6 > 5 && blast6_button != 0)
  4336. {
  4337. if (blast6_x < 350)
  4338. {
  4339. gr6 = 1;
  4340. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4341.  
  4342. }
  4343. else
  4344. gr6 = 0;
  4345. blast6_button = 3;
  4346. if (blast6_flag == 0)
  4347. {
  4348. blast6_y = jump_y + 27;
  4349. blast6_flag = 1;
  4350. }
  4351.  
  4352. iShowBMPWOBG(blast6_x, blast6_y, "blast.bmp");
  4353. if (blast6_x >= 1280)
  4354. {
  4355. blast6_x = 240;
  4356. blast6_button = 0;
  4357. blast6_flag = 0;
  4358. blast6_y = 0;
  4359. }
  4360. }
  4361.  
  4362. //Blast7
  4363.  
  4364. if (blast7_button != 0 && blast7_button != 3)
  4365. {
  4366. gr7 = 1;
  4367. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4368. }
  4369. else
  4370. gr7 = 0;
  4371. if (blast7 > 5 && blast7_button != 0)
  4372. {
  4373. if (blast7_x < 350)
  4374. {
  4375. gr7 = 1;
  4376. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4377.  
  4378. }
  4379. else
  4380. gr7 = 0;
  4381. blast7_button = 3;
  4382. if (blast7_flag == 0)
  4383. {
  4384. blast7_y = jump_y + 27;
  4385. blast7_flag = 1;
  4386. }
  4387.  
  4388. iShowBMPWOBG(blast7_x, blast7_y, "blast.bmp");
  4389. if (blast7_x >= 1280)
  4390. {
  4391. blast7_x = 240;
  4392. blast7_button = 0;
  4393. blast7_flag = 0;
  4394. blast7_y = 0;
  4395. }
  4396. }
  4397.  
  4398.  
  4399. //Blast8
  4400.  
  4401. if (blast8_button != 0 && blast8_button != 3)
  4402. {
  4403. gr8 = 1;
  4404. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4405. }
  4406. else
  4407. gr8 = 0;
  4408. if (blast8 > 5 && blast8_button != 0)
  4409. {
  4410. if (blast8_x < 350)
  4411. {
  4412. gr8 = 1;
  4413. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4414.  
  4415. }
  4416. else
  4417. gr8 = 0;
  4418. blast8_button = 3;
  4419. if (blast8_flag == 0)
  4420. {
  4421. blast8_y = jump_y + 27;
  4422. blast8_flag = 1;
  4423. }
  4424.  
  4425. iShowBMPWOBG(blast8_x, blast8_y, "blast.bmp");
  4426. if (blast8_x >= 1280)
  4427. {
  4428. blast8_x = 240;
  4429. blast8_button = 0;
  4430. blast8_flag = 0;
  4431. blast8_y = 0;
  4432. }
  4433. }
  4434.  
  4435.  
  4436. //Blast9
  4437.  
  4438. if (blast9_button != 0 && blast9_button != 3)
  4439. {
  4440. gr9 = 1;
  4441. iShowBMPWOBG(goku_x, jump_y, "b1.bmp");
  4442. }
  4443. else
  4444. gr9 = 0;
  4445. if (blast9 > 5 && blast9_button != 0)
  4446. {
  4447. if (blast9_x < 350)
  4448. {
  4449. gr9 = 1;
  4450. iShowBMPWOBG(goku_x, jump_y, "b2.bmp");
  4451.  
  4452. }
  4453. else
  4454. gr9 = 0;
  4455. blast9_button = 3;
  4456. if (blast9_flag == 0)
  4457. {
  4458. blast9_y = jump_y + 27;
  4459. blast9_flag = 1;
  4460. }
  4461.  
  4462. iShowBMPWOBG(blast9_x, blast9_y, "blast.bmp");
  4463. if (blast9_x >= 1280)
  4464. {
  4465. blast9_x = 240;
  4466. blast9_button = 0;
  4467. blast9_flag = 0;
  4468. blast9_y = 0;
  4469. }
  4470. }
  4471. }
  4472.  
  4473. //Super Blast
  4474. if (super == 2) {
  4475. if (blast_button != 0 && blast_button != 3)
  4476. {
  4477. gr = 1;
  4478. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4479. }
  4480. else
  4481. gr = 0;
  4482. if (blast > 5 && blast_button != 0)
  4483. {
  4484. if (blast_x < 350)
  4485. {
  4486. gr = 1;
  4487. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4488. }
  4489. else
  4490. gr = 0;
  4491. blast_button = 3;
  4492. if (blast_flag == 0)
  4493. {
  4494. blast_y = jump_y + 27;
  4495. blast_flag = 1;
  4496. }
  4497.  
  4498. iShowBMPWOBG(blast_x, blast_y, "s_blast.bmp");
  4499. if (blast_x >= 1280)
  4500. {
  4501. blast_x = 240;
  4502. blast_button = 0;
  4503. blast_flag = 0;
  4504. blast_y = 0;
  4505. }
  4506. }
  4507.  
  4508. //Blast1
  4509. if (blast1_button != 0 && blast1_button != 3)
  4510. {
  4511. gr1 = 1;
  4512. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4513. }
  4514. else
  4515. gr1 = 0;
  4516. if (blast1 > 5 && blast1_button != 0)
  4517. {
  4518. if (blast1_x < 350)
  4519. {
  4520. gr1 = 1;
  4521. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4522. }
  4523. else
  4524. gr1 = 0;
  4525. blast1_button = 3;
  4526. if (blast1_flag == 0)
  4527. {
  4528. blast1_y = jump_y + 27;
  4529. blast1_flag = 1;
  4530. }
  4531.  
  4532. iShowBMPWOBG(blast1_x, blast1_y, "s_blast.bmp");
  4533. if (blast1_x >= 1280)
  4534. {
  4535. blast1_x = 240;
  4536. blast1_button = 0;
  4537. blast1_flag = 0;
  4538. blast1_y = 0;
  4539. }
  4540. }
  4541.  
  4542. //Blast2
  4543.  
  4544. if (blast2_button != 0 && blast2_button != 3)
  4545. {
  4546. gr2 = 1;
  4547. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4548. }
  4549. else
  4550. gr2 = 0;
  4551. if (blast2 > 5, k, k && blast2_button != 0)
  4552. {
  4553. if (blast2_x < 350)
  4554. {
  4555. gr2 = 1;
  4556. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4557. }
  4558. else
  4559. gr2 = 0;
  4560. blast2_button = 3;
  4561. if (blast2_flag == 0)
  4562. {
  4563. blast2_y = jump_y + 27;
  4564. blast2_flag = 1;
  4565. }
  4566.  
  4567. iShowBMPWOBG(blast2_x, blast2_y, "s_blast.bmp");
  4568. if (blast2_x >= 1280)
  4569. {
  4570. blast2_x = 240;
  4571. blast2_button = 0;
  4572. blast2_flag = 0;
  4573. blast2_y = 0;
  4574. }
  4575. }
  4576.  
  4577. //Blast3
  4578. if (blast3_button != 0 && blast3_button != 3)
  4579. {
  4580. gr3 = 1;
  4581. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4582. }
  4583. else
  4584. gr3 = 0;
  4585. if (blast3 > 5 && blast3_button != 0)
  4586. {
  4587. if (blast3_x < 350)
  4588. {
  4589. gr3 = 1;
  4590. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4591. }
  4592. else
  4593. gr3 = 0;
  4594. blast3_button = 3;
  4595. if (blast3_flag == 0)
  4596. {
  4597. blast3_y = jump_y + 27;
  4598. blast3_flag = 1;
  4599. }
  4600.  
  4601. iShowBMPWOBG(blast3_x, blast3_y, "s_blast.bmp");
  4602. if (blast3_x >= 1280)
  4603. {
  4604. blast3_x = 240;
  4605. blast3_button = 0;
  4606. blast3_flag = 0;
  4607. blast3_y = 0;
  4608. }
  4609. }
  4610.  
  4611.  
  4612. //Blast4
  4613.  
  4614. if (blast4_button != 0 && blast4_button != 3)
  4615. {
  4616. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4617. gr4 = 1;
  4618. }
  4619. else
  4620. gr4 = 0;
  4621. if (blast4 > 5 && blast4_button != 0)
  4622. {
  4623. if (blast4_x < 350)
  4624. {
  4625. gr4 = 1;
  4626. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4627. }
  4628. else
  4629. gr4 = 0;
  4630. blast4_button = 3;
  4631. if (blast4_flag == 0)
  4632. {
  4633. blast4_y = jump_y + 27;
  4634. blast4_flag = 1;
  4635. }
  4636.  
  4637. iShowBMPWOBG(blast4_x, blast4_y, "s_blast.bmp");
  4638. if (blast4_x >= 1280)
  4639. {
  4640. blast4_x = 240;
  4641. blast4_button = 0;
  4642. blast4_flag = 0;
  4643. blast4_y = 0;
  4644. }
  4645. }
  4646.  
  4647.  
  4648. //Blast5
  4649.  
  4650. if (blast5_button != 0 && blast5_button != 3)
  4651. {
  4652. gr5 = 1;
  4653. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4654. }
  4655. else
  4656. gr5 = 0;
  4657. if (blast5 > 5 && blast5_button != 0)
  4658. {
  4659. if (blast5_x < 350)
  4660. {
  4661. gr5 = 1;
  4662. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4663. }
  4664. else
  4665. gr5 = 0;
  4666. blast5_button = 3;
  4667. if (blast5_flag == 0)
  4668. {
  4669. blast5_y = jump_y + 27;
  4670. blast5_flag = 1;
  4671. }
  4672.  
  4673. iShowBMPWOBG(blast5_x, blast5_y, "s_blast.bmp");
  4674. if (blast5_x >= 1280)
  4675. {
  4676. blast5_x = 240;
  4677. blast5_button = 0;
  4678. blast5_flag = 0;
  4679. blast5_y = 0;
  4680. }
  4681. }
  4682.  
  4683. //Blast6
  4684.  
  4685. if (blast6_button != 0 && blast6_button != 3)
  4686. {
  4687. gr6 = 1;
  4688. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4689. }
  4690. else
  4691. gr6 = 0;
  4692. if (blast6 > 5 && blast6_button != 0)
  4693. {
  4694. if (blast6_x < 350)
  4695. {
  4696. gr6 = 1;
  4697. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4698. }
  4699. else
  4700. gr6 = 0;
  4701. blast6_button = 3;
  4702. if (blast6_flag == 0)
  4703. {
  4704. blast6_y = jump_y + 27;
  4705. blast6_flag = 1;
  4706. }
  4707.  
  4708. iShowBMPWOBG(blast6_x, blast6_y, "s_blast.bmp");
  4709. if (blast6_x >= 1280)
  4710. {
  4711. blast6_x = 240;
  4712. blast6_button = 0;
  4713. blast6_flag = 0;
  4714. blast6_y = 0;
  4715. }
  4716. }
  4717.  
  4718. //Blast7
  4719.  
  4720. if (blast7_button != 0 && blast7_button != 3)
  4721. {
  4722. gr7 = 1;
  4723. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4724. }
  4725. else
  4726. gr7 = 0;
  4727. if (blast7 > 5 && blast7_button != 0)
  4728. {
  4729. if (blast7_x < 350)
  4730. {
  4731. gr7 = 1;
  4732. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4733. }
  4734. else
  4735. gr7 = 0;
  4736. blast7_button = 3;
  4737. if (blast7_flag == 0)
  4738. {
  4739. blast7_y = jump_y + 27;
  4740. blast7_flag = 1;
  4741. }
  4742.  
  4743. iShowBMPWOBG(blast7_x, blast7_y, "s_blast.bmp");
  4744. if (blast7_x >= 1280)
  4745. {
  4746. blast7_x = 240;
  4747. blast7_button = 0;
  4748. blast7_flag = 0;
  4749. blast7_y = 0;
  4750. }
  4751. }
  4752.  
  4753.  
  4754. //Blast8
  4755.  
  4756. if (blast8_button != 0 && blast8_button != 3)
  4757. {
  4758. gr8 = 1;
  4759. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4760. }
  4761. else
  4762. gr8 = 0;
  4763. if (blast8 > 5 && blast8_button != 0)
  4764. {
  4765. if (blast8_x < 350)
  4766. {
  4767. gr8 = 1;
  4768. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4769. }
  4770. else
  4771. gr8 = 0;
  4772. blast8_button = 3;
  4773. if (blast8_flag == 0)
  4774. {
  4775. blast8_y = jump_y + 27;
  4776. blast8_flag = 1;
  4777. }
  4778.  
  4779. iShowBMPWOBG(blast8_x, blast8_y, "s_blast.bmp");
  4780. if (blast8_x >= 1280)
  4781. {
  4782. blast8_x = 240;
  4783. blast8_button = 0;
  4784. blast8_flag = 0;
  4785. blast8_y = 0;
  4786. }
  4787. }
  4788.  
  4789.  
  4790. //Blast9
  4791.  
  4792. if (blast9_button != 0 && blast9_button != 3)
  4793. {
  4794. gr9 = 1;
  4795. iShowBMPWOBG(goku_x, jump_y, "sb1.bmp");
  4796. }
  4797. else
  4798. gr9 = 0;
  4799. if (blast9 > 5 && blast9_button != 0)
  4800. {
  4801. if (blast9_x < 350)
  4802. {
  4803. gr9 = 1;
  4804. iShowBMPWOBG(goku_x, jump_y, "sb2.bmp");
  4805. }
  4806. else
  4807. gr9 = 0;
  4808. blast9_button = 3;
  4809. if (blast9_flag == 0)
  4810. {
  4811. blast9_y = jump_y + 27;
  4812. blast9_flag = 1;
  4813. }
  4814.  
  4815. iShowBMPWOBG(blast9_x, blast9_y, "s_blast.bmp");
  4816. if (blast9_x >= 1280)
  4817. {
  4818. blast9_x = 240;
  4819. blast9_button = 0;
  4820. blast9_flag = 0;
  4821. blast9_y = 0;
  4822. }
  4823. }
  4824. }
  4825.  
  4826.  
  4827. if (spike_direction == 1) {
  4828. iShowBMPWOBGWP(spike_x, spike_y, "spikes.bmp", 0);
  4829. if (spikehit == 1)
  4830. iShowBMPWOBGWP(spike_x, spike_y, "spikesX.bmp", 0);
  4831. }
  4832. else if (spike_direction == 2) {
  4833. iShowBMPWOBGWP(spike2_x, spike_y, "spikes.bmp", 0);
  4834. if (spikehit2 == 1)
  4835. iShowBMPWOBGWP(spike2_x, spike_y, "spikesX.bmp", 0);
  4836. }
  4837. else if (spike_direction == 3) {
  4838.  
  4839. iShowBMPWOBGWP(spike3_x, spike_y, "spikes.bmp", 0);
  4840. if (spikehit3 == 1)
  4841. iShowBMPWOBGWP(spike3_x, spike_y, "spikesX.bmp", 0);
  4842. iShowBMPWOBGWP(spike4_x, spike_y, "spikes.bmp", 0);
  4843. if (spikehit4 == 1)
  4844. iShowBMPWOBGWP(spike4_x, spike_y, "spikesX.bmp", 0);
  4845. }
  4846. else if (spike_direction == 4) {
  4847. iShowBMPWOBGWP(spike5_x, spike_y, "spikes.bmp", 0);
  4848. if (spikehit5 == 1)
  4849. iShowBMPWOBGWP(spike5_x, spike_y, "spikesX.bmp", 0);
  4850. iShowBMPWOBGWP(spike6_x, spike_y, "spikes.bmp", 0);
  4851. if (spikehit6 == 1)
  4852. iShowBMPWOBGWP(spike6_x, spike_y, "spikesX.bmp", 0);
  4853. }
  4854. else if (spike_direction == 5) {
  4855. iShowBMPWOBGWP(spike7_x, spike_y, "spikes.bmp", 0);
  4856. if (spikehit7 == 1)
  4857. iShowBMPWOBGWP(spike7_x, spike_y, "spikesX.bmp", 0);
  4858. iShowBMPWOBGWP(spike8_x, spike_y, "spikes.bmp", 0);
  4859. if (spikehit8 == 1)
  4860. iShowBMPWOBGWP(spike8_x, spike_y, "spikesX.bmp", 0);
  4861. }
  4862. else if (spike_direction == 6) {
  4863. iShowBMPWOBGWP(spike9_x, spike_y, "spikes.bmp", 0);
  4864. if (spikehit9 == 1)
  4865. iShowBMPWOBGWP(spike9_x, spike_y, "spikesX.bmp", 0);
  4866.  
  4867. iShowBMPWOBGWP(spike10_x, spike_y, "spikes.bmp", 0);
  4868. if (spikehit10 == 1)
  4869. iShowBMPWOBGWP(spike10_x, spike_y, "spikesX.bmp", 0);
  4870.  
  4871. iShowBMPWOBGWP(spike11_x, spike_y, "spikes.bmp", 0);
  4872. if (spikehit11 == 1)
  4873. iShowBMPWOBGWP(spike11_x, spike_y, "spikesX.bmp", 0);
  4874.  
  4875. }
  4876.  
  4877.  
  4878.  
  4879. //cellJr
  4880. if (cell == 0) {
  4881. iShowBMPWOBG(cell_x, cell_y, "c1.bmp");
  4882. }
  4883. if (cell1 == 0) {
  4884. iShowBMPWOBG(cell10_x, cell10_y, "c1.bmp");
  4885. }
  4886. if (cell2 == 0) {
  4887. iShowBMPWOBG(cell20_x, cell20_y, "c1.bmp");
  4888. }
  4889. if (hit == 1) {
  4890. iShowBMPWOBG(cell_x, cell_y, "c2.bmp");
  4891. }
  4892. if (hit1 == 1) {
  4893. iShowBMPWOBG(cell10_x, cell10_y, "c2.bmp");
  4894. }
  4895. if (hit2 == 1) {
  4896. iShowBMPWOBG(cell20_x, cell20_y, "c2.bmp");
  4897. }
  4898.  
  4899.  
  4900. if (senzu == 1) {
  4901. iShowBMPWOBGWP(senzu_x, senzu_y, "senzu.bmp", 0);
  4902. }
  4903. if (super == 1)
  4904. iShowBMP(0, 0, "st_r.bmp");
  4905. if (super == 2)
  4906. iShowBMP(0, 0, "st_ss.bmp");
  4907. iShowBMPWOBGWP(0, 350, "HP.bmp", 0);
  4908. iShowBMPWOBGWP(0, 300, "score.bmp", 0);
  4909. iSetColor(255, 255, 255);
  4910. char p[500];
  4911. char b[100];
  4912. p[0] = '\0';
  4913. strcat_s(p, itoa(score, b, 10));
  4914. iText(40, 280, p, GLUT_BITMAP_TIMES_ROMAN_24);
  4915.  
  4916.  
  4917. //HP_Bar
  4918. if (dis > 5 && dis < 50000){
  4919. if (damage >= 500){
  4920. red = (255 - damage / 3.921568627) * 2;
  4921. green = 255;
  4922. }
  4923. else{
  4924. green = (damage / 3.921568627) * 2;
  4925. red = 255;
  4926. }
  4927. iSetColor(red, green, 0);
  4928. char q[500];
  4929. char l[100];
  4930. q[0] = '\0';
  4931. strcat(q, itoa(damage / 10, l, 10));
  4932. strcat(q, "%");
  4933. iText(46, 744, q, GLUT_BITMAP_HELVETICA_18);
  4934. iFilledRectangle(52, 453, 19, (damage / 4)*1.126);
  4935. iFilledCircle(62.5, 410, 10);
  4936. }
  4937. else if (dis != 0 && dis >= 50000)
  4938. {
  4939. if (damage >= 500){
  4940. red = (255 - damage / 3.921568627) * 2;
  4941. green = 255;
  4942. }
  4943. else{
  4944. green = (damage / 3.921568627) * 2;
  4945. red = 255;
  4946. }
  4947. if (frieza_life >= 3 * 500){
  4948. fgreen = (255 - frieza_life / (3.921568627 * 3)) * 2;
  4949. fred = 255;
  4950. }
  4951. else{
  4952. fred = (frieza_life / (3.921568627 * 3)) * 2;
  4953. fgreen = 255;
  4954. }
  4955. iSetColor(red, green, 0);
  4956. char q[500];
  4957. char l[100];
  4958. q[0] = '\0';
  4959. strcat(q, itoa(damage / 10, l, 10));
  4960. strcat(q, "%");
  4961. iText(46, 744, q, GLUT_BITMAP_HELVETICA_18);
  4962. iFilledRectangle(52, 453, 8.7, (damage / 4)*1.126);
  4963. iFilledCircle(62.5, 410, 10);
  4964. iSetColor(fred, fgreen, 0);
  4965. iFilledRectangle(62.5, 453, 8.7, (frieza_life / 12)*1.126);
  4966.  
  4967. }
  4968. //DragonBalls ST bar
  4969. if (db == 1){
  4970. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  4971. }
  4972. if (db == 2){
  4973. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  4974. iShowBMPWOBGWP(72, 180, "dbs2.bmp", 0);
  4975. }
  4976. if (db == 3){
  4977. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  4978. iShowBMPWOBGWP(72, 180, "dbs2.bmp", 0);
  4979. iShowBMPWOBGWP(28, 130, "dbs3.bmp", 0);
  4980. }
  4981. if (db == 4){
  4982. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  4983. iShowBMPWOBGWP(72, 180, "dbs2.bmp", 0);
  4984. iShowBMPWOBGWP(28, 130, "dbs3.bmp", 0);
  4985. iShowBMPWOBGWP(72, 130, "dbs4.bmp", 0);
  4986. }
  4987. if (db == 5){
  4988. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  4989. iShowBMPWOBGWP(72, 180, "dbs2.bmp", 0);
  4990. iShowBMPWOBGWP(28, 130, "dbs3.bmp", 0);
  4991. iShowBMPWOBGWP(72, 130, "dbs4.bmp", 0);
  4992. iShowBMPWOBGWP(28, 80, "dbs5.bmp", 0);
  4993. }
  4994. if (db == 6){
  4995. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  4996. iShowBMPWOBGWP(72, 180, "dbs2.bmp", 0);
  4997. iShowBMPWOBGWP(28, 130, "dbs3.bmp", 0);
  4998. iShowBMPWOBGWP(72, 130, "dbs4.bmp", 0);
  4999. iShowBMPWOBGWP(28, 80, "dbs5.bmp", 0);
  5000. iShowBMPWOBGWP(72, 80, "dbs6.bmp", 0);
  5001. }
  5002. if (db >= 7)
  5003. {
  5004. iShowBMPWOBGWP(28, 180, "dbs1.bmp", 0);
  5005. iShowBMPWOBGWP(72, 180, "dbs2.bmp", 0);
  5006. iShowBMPWOBGWP(28, 130, "dbs3.bmp", 0);
  5007. iShowBMPWOBGWP(72, 130, "dbs4.bmp", 0);
  5008. iShowBMPWOBGWP(28, 80, "dbs5.bmp", 0);
  5009. iShowBMPWOBGWP(72, 80, "dbs6.bmp", 0);
  5010. iShowBMPWOBGWP(50, 30, "dbs7.bmp", 0);
  5011. }
  5012.  
  5013.  
  5014.  
  5015. //iShowBMPWOBG(frieza_x, frieza_y, "frieza.bmp");
  5016. //place your drawing codes here
  5017.  
  5018. }
  5019.  
  5020.  
  5021. if (mode == 1)
  5022. {
  5023. iShowBMP(340, 209, nhs_str);
  5024. nhs_co++;
  5025. if (nhs_co % 20 == 0)
  5026. {
  5027. nhs_str[0] = '\0';
  5028. strcat(nhs_str, "nhs");
  5029. char gol[10];
  5030. strcat(nhs_str, itoa((nhsC + 1), gol, 10));
  5031. strcat(nhs_str, ".bmp");
  5032. nhsC++;
  5033. if (nhsC >= 6)
  5034. nhsC = 0;
  5035. }
  5036. iRectangle(570, 350, 150, 40);
  5037. iText(580, 360, string, GLUT_BITMAP_TIMES_ROMAN_24);
  5038. }
  5039. else if (hsc_st == 1 && st_sc != 3)
  5040. {
  5041. fr_st++;
  5042. if (fr_st == 1)
  5043. read();
  5044. iShowBMP(hs_x, hs_y, hsc_str);
  5045. hsc_co++;
  5046.  
  5047.  
  5048. //dx score
  5049.  
  5050. if (score_direction == 1) {
  5051. hs_x -= dsd;
  5052. hs_y += dsd;
  5053. }
  5054. if (score_direction == 2) {
  5055. hs_x += dsd;
  5056. hs_y += dsd;
  5057. }
  5058. if (score_direction == 3) {
  5059. hs_x -= dsd;
  5060. hs_y -= dsd;
  5061. }
  5062. if (score_direction == 4) {
  5063. hs_x += dsd;
  5064. hs_y -= dsd;
  5065. }
  5066. if (score_direction == 5) {
  5067. hs_y += dsd;
  5068. }
  5069. if (score_direction == 6) {
  5070. hs_y -= dsd;
  5071. }
  5072.  
  5073.  
  5074.  
  5075. if (hs_x <= 1) {
  5076. if (score_direction == 1) {
  5077. score_direction = 2;
  5078. }
  5079. else if (score_direction == 3) {
  5080. score_direction = 4;
  5081. }
  5082. }
  5083. else if (hs_x >= 480) {
  5084. if (score_direction == 2) {
  5085. score_direction = 1;
  5086. }
  5087.  
  5088. if (score_direction == 4) {
  5089. score_direction = 3;
  5090.  
  5091. }
  5092. }
  5093. else if (hs_y >= 256) {
  5094. if (score_direction == 2) {
  5095. score_direction = 4;
  5096. }
  5097.  
  5098. if (score_direction == 1) {
  5099. score_direction = 3;
  5100.  
  5101. }
  5102. }
  5103. else if (hs_y <= 0) {
  5104. if (score_direction == 4) {
  5105. score_direction = 2;
  5106. }
  5107.  
  5108. if (score_direction == 3) {
  5109. score_direction = 1;
  5110.  
  5111. }
  5112. }
  5113.  
  5114. if (hsc_co % 20 == 0)
  5115. {
  5116. hsc_str[0] = '\0';
  5117. strcat(hsc_str, "hs");
  5118. char gol[10];
  5119. strcat(hsc_str, itoa((hsco + 1), gol, 10));
  5120. strcat(hsc_str, ".bmp");
  5121. hsco++;
  5122. if (hsco >= 6)
  5123. hsco = 0;
  5124. }
  5125.  
  5126.  
  5127.  
  5128.  
  5129. iText(hs_x + 180, hs_y + 52, name[6], GLUT_BITMAP_TIMES_ROMAN_24);
  5130. iText(hs_x + 180, hs_y + 107, name[5], GLUT_BITMAP_TIMES_ROMAN_24);
  5131. iText(hs_x + 180, hs_y + 161, name[4], GLUT_BITMAP_TIMES_ROMAN_24);
  5132. iText(hs_x + 180, hs_y + 218, name[3], GLUT_BITMAP_TIMES_ROMAN_24);
  5133. iText(hs_x + 180, hs_y + 270.5, name[2], GLUT_BITMAP_TIMES_ROMAN_24);
  5134. iText(hs_x + 180, hs_y + 321, name[1], GLUT_BITMAP_TIMES_ROMAN_24);
  5135. iText(hs_x + 180, hs_y + 372, name[0], GLUT_BITMAP_TIMES_ROMAN_24);
  5136. char Spr[1000];
  5137. iText(hs_x + 600, hs_y + 52, itoa((fscore[6]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5138. iText(hs_x + 600, hs_y + 107, itoa((fscore[5]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5139. iText(hs_x + 600, hs_y + 161, itoa((fscore[4]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5140. iText(hs_x + 600, hs_y + 218, itoa((fscore[3]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5141. iText(hs_x + 600, hs_y + 270.5, itoa((fscore[2]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5142. iText(hs_x + 600, hs_y + 321, itoa((fscore[1]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5143. iText(hs_x + 600, hs_y + 372, itoa((fscore[0]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5144.  
  5145. iText(hs_x + 290, hs_y + 52, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5146. iText(hs_x + 290, hs_y + 107, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5147. iText(hs_x + 290, hs_y + 161, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5148. iText(hs_x + 290, hs_y + 218, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5149. iText(hs_x + 290, hs_y + 270.5, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5150. iText(hs_x + 290, hs_y + 321, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5151. iText(hs_x + 290, hs_y + 372, "--------------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5152.  
  5153.  
  5154.  
  5155.  
  5156.  
  5157. if (line == 0) {
  5158. iRectangle(hs_x + 160, hs_y + 350, 540, 60);
  5159. }
  5160. else if (line == 1) {
  5161. iRectangle(hs_x + 160, hs_y + 297, 540, 60);
  5162. }
  5163. else if (line == 2) {
  5164. iRectangle(hs_x + 160, hs_y + 245, 540, 60);
  5165. }
  5166. else if (line == 3) {
  5167. iRectangle(hs_x + 160, hs_y + 194, 540, 60);
  5168. }
  5169. else if (line == 4) {
  5170. iRectangle(hs_x + 160, hs_y + 136, 540, 60);
  5171. }
  5172. else if (line == 5) {
  5173. iRectangle(hs_x + 160, hs_y + 82, 540, 60);
  5174. }
  5175. else if (line == 6) {
  5176. iRectangle(hs_x + 160, hs_y + 28, 540, 60);
  5177. }
  5178.  
  5179.  
  5180. if (res == 1){
  5181. iPauseTimer(2);
  5182. res = 0;
  5183. }
  5184. }
  5185. if (hsc_st == 1 && st_sc == 3)
  5186. {
  5187. fr_st++;
  5188. if (fr_st == 1)
  5189. read();
  5190. iShowBMP(hs_x, hs_y, hsc_str);
  5191. hsc_co++;
  5192.  
  5193.  
  5194. //dx score
  5195.  
  5196. if (score_direction == 1) {
  5197. hs_x -= dsd;
  5198. hs_y += dsd;
  5199. }
  5200. if (score_direction == 2) {
  5201. hs_x += dsd;
  5202. hs_y += dsd;
  5203. }
  5204. if (score_direction == 3) {
  5205. hs_x -= dsd;
  5206. hs_y -= dsd;
  5207. }
  5208. if (score_direction == 4) {
  5209. hs_x += dsd;
  5210. hs_y -= dsd;
  5211. }
  5212. if (score_direction == 5) {
  5213. hs_y += dsd;
  5214. }
  5215. if (score_direction == 6) {
  5216. hs_y -= dsd;
  5217. }
  5218.  
  5219.  
  5220.  
  5221. if (hs_x <= 1) {
  5222. if (score_direction == 1) {
  5223. score_direction = 2;
  5224. }
  5225. else if (score_direction == 3) {
  5226. score_direction = 4;
  5227. }
  5228. }
  5229. else if (hs_x >= 480) {
  5230. if (score_direction == 2) {
  5231. score_direction = 1;
  5232. }
  5233.  
  5234. if (score_direction == 4) {
  5235. score_direction = 3;
  5236.  
  5237. }
  5238. }
  5239. else if (hs_y >= 256) {
  5240. if (score_direction == 2) {
  5241. score_direction = 4;
  5242. }
  5243.  
  5244. if (score_direction == 1) {
  5245. score_direction = 3;
  5246.  
  5247. }
  5248. }
  5249. else if (hs_y <= 0) {
  5250. if (score_direction == 4) {
  5251. score_direction = 2;
  5252. }
  5253.  
  5254. if (score_direction == 3) {
  5255. score_direction = 1;
  5256.  
  5257. }
  5258. }
  5259.  
  5260.  
  5261. if (hsc_co % 20 == 0)
  5262. {
  5263. hsc_str[0] = '\0';
  5264. strcat(hsc_str, "hs");
  5265. char gol[10];
  5266. strcat(hsc_str, itoa((hsco + 1), gol, 10));
  5267. strcat(hsc_str, ".bmp");
  5268. hsco++;
  5269. if (hsco >= 6)
  5270. hsco = 0;
  5271. }
  5272. if (hsc_co % 10 == 0)
  5273. iSetColor(255, 0, 0);
  5274. if (hsc_co % 20 == 0)
  5275. iSetColor(0, 255, 0);
  5276. if (hsc_co % 30 == 0)
  5277. iSetColor(0, 0, 255);
  5278. if (hsc_co % 40 == 0)
  5279. iSetColor(255, 255, 0);
  5280. if (hsc_co % 50 == 0)
  5281. iSetColor(255, 0, 255);
  5282. if (hsc_co % 60 == 0)
  5283. iSetColor(0, 255, 255);
  5284. if (hsc_co % 70 == 0)
  5285. iSetColor(255, 255, 255);
  5286. iText(hs_x + 180, hs_y + 52, name[6], GLUT_BITMAP_TIMES_ROMAN_24);
  5287. iText(hs_x + 180, hs_y + 107, name[5], GLUT_BITMAP_TIMES_ROMAN_24);
  5288. iText(hs_x + 180, hs_y + 161, name[4], GLUT_BITMAP_TIMES_ROMAN_24);
  5289. iText(hs_x + 180, hs_y + 218, name[3], GLUT_BITMAP_TIMES_ROMAN_24);
  5290. iText(hs_x + 180, hs_y + 270.5, name[2], GLUT_BITMAP_TIMES_ROMAN_24);
  5291. iText(hs_x + 180, hs_y + 321, name[1], GLUT_BITMAP_TIMES_ROMAN_24);
  5292. iText(hs_x + 180, hs_y + 372, name[0], GLUT_BITMAP_TIMES_ROMAN_24);
  5293. char Spr[1000];
  5294. iText(hs_x + 600, hs_y + 52, itoa((fscore[6]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5295. iText(hs_x + 600, hs_y + 107, itoa((fscore[5]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5296. iText(hs_x + 600, hs_y + 161, itoa((fscore[4]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5297. iText(hs_x + 600, hs_y + 218, itoa((fscore[3]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5298. iText(hs_x + 600, hs_y + 270.5, itoa((fscore[2]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5299. iText(hs_x + 600, hs_y + 321, itoa((fscore[1]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5300. iText(hs_x + 600, hs_y + 372, itoa((fscore[0]), Spr, 10), GLUT_BITMAP_TIMES_ROMAN_24);
  5301.  
  5302. iText(hs_x + 290, hs_y + 52, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5303. iText(hs_x + 290, hs_y + 107, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5304. iText(hs_x + 290, hs_y + 161, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5305. iText(hs_x + 290, hs_y + 218, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5306. iText(hs_x + 290, hs_y + 270.5, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5307. iText(hs_x + 290, hs_y + 321, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5308. iText(hs_x + 290, hs_y + 372, " ----------------", GLUT_BITMAP_TIMES_ROMAN_24);
  5309.  
  5310. if (res == 1){
  5311. iPauseTimer(2);
  5312. res = 0;
  5313. }
  5314. }
  5315. }
  5316.  
  5317. /*
  5318. function iMouseMove() is called when the user presses and drags the mouse.
  5319. (mx, my) is the position where the mouse pointer is.
  5320. */
  5321.  
  5322.  
  5323. void iMouseMove(int mx, int my)
  5324. {
  5325. //place your codes here
  5326. }
  5327. /*
  5328. function iMouse() is called when the user presses/releases the mouse.
  5329. (mx, my) is the position where the mouse pointer is.
  5330. */
  5331. void iMouse(int button, int state, int mx, int my)
  5332. {
  5333. if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
  5334. {
  5335. blast_co++;
  5336.  
  5337. if (blast_co % 10 == 9)
  5338. blast_button = 1;
  5339.  
  5340. if (blast_co % 10 == 8)
  5341. blast1_button = 1;
  5342.  
  5343. if (blast_co % 10 == 7)
  5344. blast2_button = 1;
  5345.  
  5346. if (blast_co % 10 == 6)
  5347. blast3_button = 1;
  5348.  
  5349. if (blast_co % 10 == 5)
  5350. blast4_button = 1;
  5351.  
  5352. if (blast_co % 10 == 4)
  5353. blast5_button = 1;
  5354.  
  5355. if (blast_co % 10 == 3)
  5356. blast6_button = 1;
  5357.  
  5358. if (blast_co % 10 == 2)
  5359. blast7_button = 1;
  5360.  
  5361. if (blast_co % 10 == 1)
  5362. blast8_button = 1;
  5363.  
  5364. if (blast_co % 10 == 0)
  5365. blast9_button = 1;
  5366. }
  5367. if (button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN)
  5368. {
  5369. jump_co++;
  5370. if (jump_co == 1)
  5371. {
  5372. jumping = 1;
  5373. }
  5374. else if (jump_co == 2)
  5375. {
  5376. jumping = 1;
  5377. jump_limit = jump_y + 300;
  5378. jump_dif = jd;
  5379. jump_co++;
  5380. }
  5381. }
  5382. }
  5383. /*iPassiveMouseMove is called to detect and use
  5384. the mouse point without pressing any button */
  5385. void iPassiveMouseMove(int mx, int my)
  5386. {
  5387. //place your code here
  5388. if (mx == 2){} /*Something to do with mx*/
  5389. else if (my == 2){} /*Something to do with my*/
  5390. }
  5391. /*
  5392. function iKeyboard() is called whenever the user hits a key in keyboard.
  5393. key- holds the ASCII value of the key pressed.
  5394. */
  5395. void iKeyboard(unsigned char key)
  5396. {
  5397. int i;
  5398.  
  5399. if (mode == 1)
  5400. {
  5401.  
  5402.  
  5403. if (key == '\r')
  5404. {
  5405. mode = 0;
  5406. strcpy(name[7], string);
  5407. for (i = 0; i < len; i++)
  5408. string[i] = 0;
  5409. len = 0;
  5410. sortit();
  5411. find();
  5412. hsc_st = 1;
  5413. }
  5414. else if (key != ' '&&len <= 12 && key != '\b')
  5415. {
  5416. string[len] = key;
  5417. len++;
  5418. }
  5419. else if (key == '\b'&&len>0)
  5420. {
  5421. string[--len] = NULL;
  5422. }
  5423. }
  5424. else{
  5425. if (key == ' ')
  5426. {
  5427. if (story_st >= 1 && story_st <= 7)
  5428. {
  5429. story_st = 7;
  5430. }
  5431. else{
  5432. jump_co++;
  5433. if (jump_co == 1)
  5434. {
  5435. jumping = 1;
  5436. }
  5437. else if (jump_co == 2)
  5438. {
  5439. jumping = 1;
  5440. jump_limit = jump_y + 300;
  5441. jump_dif = jd;
  5442. jump_co++;
  5443. }
  5444. }
  5445. }
  5446. if (key == 'x' || key == 'X')
  5447. {
  5448. blast_co++;
  5449.  
  5450. if (blast_co % 10 == 9)
  5451. blast_button = 1;
  5452.  
  5453. if (blast_co % 10 == 8)
  5454. blast1_button = 1;
  5455.  
  5456. if (blast_co % 10 == 7)
  5457. blast2_button = 1;
  5458.  
  5459. if (blast_co % 10 == 6)
  5460. blast3_button = 1;
  5461.  
  5462. if (blast_co % 10 == 5)
  5463. blast4_button = 1;
  5464.  
  5465. if (blast_co % 10 == 4)
  5466. blast5_button = 1;
  5467.  
  5468. if (blast_co % 10 == 3)
  5469. blast6_button = 1;
  5470.  
  5471. if (blast_co % 10 == 2)
  5472. blast7_button = 1;
  5473.  
  5474. if (blast_co % 10 == 1)
  5475. blast8_button = 1;
  5476.  
  5477. if (blast_co % 10 == 0)
  5478. blast9_button = 1;
  5479.  
  5480. }
  5481.  
  5482. int gg = 0;
  5483. if (key == '\r'){
  5484. if (st_sc == 0)
  5485. {
  5486. st_sc = 1;
  5487.  
  5488. }
  5489.  
  5490. else if (st_sc == 1)
  5491. {
  5492. st_sc = 100;
  5493. load_st = 1;
  5494. }
  5495. else if (st_sc == 2)
  5496. {
  5497. st_sc = 100;
  5498. ins_st = 1;
  5499. }
  5500. else if (st_sc == 3)
  5501. {
  5502. st_sc = 100;
  5503. hs_st = 1;
  5504. }
  5505. else if (st_sc == 4)
  5506. {
  5507. exit(0);
  5508. }
  5509. else if (story_st >= 1 && story_st <= 7)
  5510. {
  5511. if (story_st == 1)
  5512. frb = 15;
  5513. if (story_st == 2)
  5514. seb = 15;
  5515. if (story_st == 3)
  5516. thb = 15;
  5517. if (story_st == 4)
  5518. fob = 15;
  5519. if (story_st == 5)
  5520. fib = 15;
  5521. if (story_st == 6)
  5522. sib = 15;
  5523. }
  5524.  
  5525. if (pause_state == 1)
  5526. {
  5527. pause_state = 0;
  5528. p_co++;
  5529. }
  5530. else if (pause_state == 2)
  5531. {
  5532. yes_st = 1;
  5533. pause_state = 0;
  5534. p_co++;
  5535.  
  5536. }
  5537. else if (yes_st == 2 && pause_state == 0){
  5538. pause_state = 2;
  5539. p_co++;
  5540. yes_st = 0;
  5541. }
  5542.  
  5543. else if (yes_st == 1 && pause_state == 0)
  5544. {
  5545.  
  5546. st_sc = 1;
  5547. yes_st = 0;
  5548. gg++;
  5549. if (gg == 1){
  5550. all_again();
  5551. }
  5552. }
  5553. else if (hsc_st == 1 && go == 1)
  5554. hsc_st = 0;
  5555. else if (sco_st == 1)
  5556. {
  5557. if (sco_co >= 22){
  5558. sco_st = 0;
  5559. gg++;
  5560. if (gg == 1){
  5561. all_again();
  5562. }
  5563. go = 0;
  5564. iResumeTimer(2);
  5565. }
  5566. }
  5567. else if (sco_st == 2)
  5568. {
  5569. if (sco_co >= 22){
  5570. gg++;
  5571. st_sc = 1;
  5572. if (gg == 1){
  5573. all_again();
  5574. }
  5575. sco_st = 0;
  5576. go = 0;
  5577. }
  5578.  
  5579. }
  5580.  
  5581. }
  5582.  
  5583.  
  5584.  
  5585. //cheats
  5586. if (key == 's') {
  5587. if (s == 0)
  5588. s++;
  5589. else {
  5590. s = 0;
  5591. }
  5592. }
  5593. if (key == 'a') {
  5594. if (s == 1 || s == 4) {
  5595. s++;
  5596. }
  5597. else {
  5598. s = 0;
  5599. }
  5600. }
  5601. if (key == 'i') {
  5602. if (s == 2) {
  5603. s++;
  5604. }
  5605. else {
  5606. s = 0;
  5607. }
  5608. if (g == 1) {
  5609. g++;
  5610. }
  5611. else {
  5612. g = 0;
  5613. }
  5614. }
  5615. if (key == 'y') {
  5616. if (s == 3) {
  5617. s++;
  5618. }
  5619. else {
  5620. s = 0;
  5621. }
  5622. if (g == 3) {
  5623. g++;
  5624. }
  5625. else {
  5626. g = 0;
  5627. }
  5628. }
  5629.  
  5630. if (key == 'n') {
  5631. if (s == 5) {
  5632. s++;
  5633. }
  5634. else {
  5635. s = 0;
  5636. }
  5637.  
  5638.  
  5639. if (s == 6) {
  5640. super = 2;
  5641. if (s_anim != 3)
  5642. s_anim = 1;
  5643.  
  5644. }
  5645.  
  5646. if (g == 2) {
  5647. g++;
  5648. }
  5649. else {
  5650. g = 0;
  5651. }
  5652. }
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660. if (key == 'g'){
  5661. if (g == 0) {
  5662. g++;
  5663. }
  5664.  
  5665. else {
  5666. g = 0;
  5667. }
  5668. }
  5669. if (key == 'u'){
  5670. if (g == 4) {
  5671. g++;
  5672. }
  5673.  
  5674. else {
  5675. g = 0;
  5676. }
  5677.  
  5678. if (g == 5) {
  5679. if (gol_anim == 0)
  5680. gol_anim = 1;
  5681. gol_frieza = 1;
  5682. }
  5683.  
  5684.  
  5685. }
  5686.  
  5687.  
  5688. if (key == 'h') {
  5689. if (c == 0) {
  5690. c++;
  5691. }
  5692. else {
  5693. c = 0;
  5694. }
  5695. }
  5696. if (key == 'e') {
  5697. if (c == 1) {
  5698. c++;
  5699. }
  5700. else {
  5701. c = 0;
  5702. }
  5703. }
  5704.  
  5705. if (key == 'l') {
  5706. if (c == 2 || c == 3) {
  5707. c++;
  5708. }
  5709. else {
  5710. c = 0;
  5711. }
  5712.  
  5713. if (c == 4) {
  5714. dis = 50000;
  5715. }
  5716. }
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722. if ((key == 'p') || (key == 'P') && go == 0 && !(sp_sc >= 0 && sp_sc <= 2) && !(st_sc >= 0 && st_sc <= 4) && !(yes_st >= 1 && yes_st <= 2))
  5723. {
  5724. p_co++;
  5725. if (p_co % 2 == 1 && load_st != 1)
  5726. pause_state = 1;
  5727. else
  5728. pause_state = 0;
  5729. }
  5730. if (key == '\b')
  5731. {
  5732. if (ins_st == 1)
  5733. {
  5734. st_sc = 2;
  5735. ins_st = 0;
  5736. }
  5737. if (hs_st == 1)
  5738. {
  5739. st_sc = 3;
  5740. hs_st = 0;
  5741. }
  5742. }
  5743.  
  5744. }
  5745. //place your codes for other keys here
  5746. }
  5747. /*
  5748. function iSpecialKeyboard() is called whenver user hits special keys like-
  5749. function keys, home, end, pg up, pg down, arraows etc. you have to use
  5750. appropriate constants to detect them. A list is:
  5751. GLUT_KEY_F1, GLUT_KEY_F2, GLUT_KEY_F3, GLUT_KEY_F4, GLUT_KEY_F5, GLUT_KEY_F6,
  5752. GLUT_KEY_F7, GLUT_KEY_F8, GLUT_KEY_F9, GLUT_KEY_F10, GLUT_KEY_F11, GLUT_KEY_F12,
  5753. GLUT_KEY_LEFT, GLUT_KEY_UP, GLUT_KEY_RIGHT, GLUT_KEY_DOWN, GLUT_KEY_PAGE UP,
  5754. GLUT_KEY_PAGE DOWN, GLUT_KEY_HOME, GLUT_KEY_END, GLUT_KEY_INSERT
  5755. */
  5756. void iSpecialKeyboard(unsigned char key)
  5757. {
  5758. if (key == GLUT_KEY_END)
  5759. {
  5760. st_sc = 1;
  5761. }
  5762. if (key == GLUT_KEY_UP&&st_sc != 0)
  5763. {
  5764. if (st_sc == 1)
  5765. st_sc = 4;
  5766. else
  5767. st_sc--;
  5768. if (pause_state == 1)
  5769. pause_state = 2;
  5770. else if (pause_state == 2)
  5771. pause_state = 1;
  5772. if (sco_st == 1)
  5773. sco_st = 2;
  5774. else if (sco_st == 2)
  5775. sco_st = 1;
  5776. }
  5777. if (key == GLUT_KEY_DOWN&&st_sc != 0)
  5778. {
  5779. if (st_sc == 4)
  5780. st_sc = 1;
  5781. else
  5782. st_sc++;
  5783. if (pause_state == 1)
  5784. pause_state = 2;
  5785. else if (pause_state == 2)
  5786. pause_state = 1;
  5787.  
  5788. if (sco_st == 1)
  5789. sco_st = 2;
  5790. else if (sco_st == 2)
  5791. sco_st = 1;
  5792. }
  5793. if (key == GLUT_KEY_LEFT&&st_sc != 0){
  5794.  
  5795. if (yes_st == 1)
  5796. yes_st = 2;
  5797. else if (yes_st == 2)
  5798. yes_st = 1;
  5799. }
  5800. if (key == GLUT_KEY_RIGHT&&st_sc != 0){
  5801.  
  5802. if (yes_st == 1)
  5803. yes_st = 2;
  5804. else if (yes_st == 2)
  5805. yes_st = 1;
  5806. }
  5807. //place your codes for other keys here
  5808. }
  5809.  
  5810. int main()
  5811. {
  5812. iSetTimer(150, goku_run);
  5813. iSetTimer(1, goku_blast);
  5814. iSetTimer(20, anim);
  5815. srand(time(NULL));
  5816. srand(time(NULL));
  5817. //PlaySound("Goku_SSJ", NULL, SND_ASYNC);
  5818. iInitialize(1280, 768, "Our Last Hope");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement