Advertisement
Guest User

Untitled

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