Advertisement
Guest User

Untitled

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