Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.42 KB | None | 0 0
  1. // ARKYBALL by Jason Oakley. 2000.
  2. //
  3. int ball_x, ball_y, x_ball_dir, y_ball_dir, ball_max_y;
  4. int bat_x, bat_y, bat_x_min, bat_x_max, bat_width;
  5. int bbxdx, bbydy;
  6. int brick_x[130], brick_y[130], hitbrick, brickhitno, brick_type[130];
  7. int levelno, silver[70];
  8. int Destructable_Bricks, Bricks_To_Destroy;
  9. int i, j, z, elongate, top, letr;
  10. int hivz_score, playervz_score, lives;
  11. int bonustime, indestructo, breakout, bottombounce, bonus_bat;
  12. char *mem;
  13. char Level0[130],Level1[130],Level2[130],Level3[130],Level4[130],Level5[130],Level6[130];
  14. char Level7[130],Level8[130],Level9[130],Level10[130],Level11[130],Level12[130],Level13[130];
  15.  
  16.  
  17. Init_Intro()
  18. {
  19. ball_x = 5;
  20. ball_y = 45;
  21. bat_x = ball_x-6;
  22. bat_y = 59;
  23. bbxdx = 1;
  24. bbydy = 2;
  25. top = 14;
  26. letr = 0;
  27. }
  28.  
  29. Init_Play()
  30. {
  31. bat_x = 38 + rand(10);
  32. bat_y = 62;
  33. bat_width = 8;
  34. bat_x_min = 0;
  35. bat_x_max = 103;
  36.  
  37. ball_x = bat_x + (bat_width/2);
  38. ball_y = 60;
  39.  
  40. draw_gamefield();
  41.  
  42. Next_Level(levelno);
  43.  
  44. x_ball_dir = 1;
  45. y_ball_dir = 1;
  46.  
  47. bat_plot(bat_x,bat_y,bat_width);
  48.  
  49. /* Hi vz_score Display */
  50. Display_vz_score(26, 24, hivz_score, 1);
  51.  
  52.  
  53. /* Player vz_score Display */
  54. Display_vz_score(26, 38, playervz_score, 1);
  55.  
  56.  
  57. /* Level No Display */
  58. Display_vz_score(27,52,levelno+1, 0);
  59.  
  60. vz_score(31 + (32 * 38),0);
  61. vz_score(31 + (32 * 24),0);
  62. }
  63.  
  64. Level_Complete()
  65. {
  66. int i,n,x,y,location;
  67. levelno++;
  68. if (levelno=13) {
  69. levelno=0;}
  70. Next_Level(levelno);
  71. ball_erase(ball_x,ball_y);
  72. bat_x = 38 + rand(10);
  73. bat_width = 8;
  74. ball_x = bat_x + (bat_width/2);
  75. ball_y = 60;
  76. y_ball_dir = -1;
  77. x_ball_dir = 1;
  78. Display_vz_score(27,52,levelno+1, 0);
  79. }
  80.  
  81. Next_Level(lev)
  82. int lev;
  83. {
  84. switch(lev) {
  85. case 0: Display_Level(Level0); break;
  86. case 1: Display_Level(Level1); break;
  87. case 2: Display_Level(Level2); break;
  88. case 3: Display_Level(Level3); break;
  89. case 4: Display_Level(Level4); break;
  90. case 5: Display_Level(Level5); break;
  91. case 6: Display_Level(Level6); break;
  92. case 7: Display_Level(Level7); break;
  93. case 8: Display_Level(Level8); break;
  94. case 9: Display_Level(Level9); break;
  95. case 10: Display_Level(Level10); break;
  96. case 11: Display_Level(Level11); break;
  97. case 12: Display_Level(Level12); break;
  98. case 13: Display_Level(Level13); break;
  99. }
  100. NL_Tune();
  101. }
  102.  
  103. /* Erase brick */
  104. brick_erase(n)
  105. int n;
  106. {
  107. int location;
  108. location = (32 * brick_y[n]) + (brick_x[n]/4) + 28672;
  109. brick(location,0);
  110. }
  111.  
  112. /* Add more to vz_score and display it */
  113. vz_score_add(value)
  114. int value;
  115. {
  116. playervz_score += value;
  117. if (playervz_score > 32767) playervz_score =0;
  118.  
  119. /* Player vz_score Display */
  120. Display_vz_score(26, 38, playervz_score, 0);
  121. vz_score(26 + (32 * 38) + 5,0);
  122.  
  123. if (playervz_score > hivz_score) {
  124. hivz_score = playervz_score;
  125. /* Hi vz_score Display */
  126. Display_vz_score(26, 24, hivz_score, 0);
  127. vz_score(26 + (32 * 24) + 5,0);
  128. }
  129.  
  130. if ((playervz_score > bonus_bat) && (lives <3)) { lives++; bonus_bat +=2000; }
  131. }
  132.  
  133.  
  134. /* Display Number of Lives left */
  135. Display_Lives(life)
  136. int life;
  137. {
  138. bat_erase(105,60,6);
  139. bat_erase(113,60,6);
  140. bat_erase(121,60,6);
  141.  
  142. if (life>0) bat_plot(105,60,6);
  143. if (life>1) bat_plot(113,60,6);
  144. if (life>2) bat_plot(121,60,6);
  145. }
  146.  
  147. /* Player Die Routine */
  148. Player_Die(bat_x, bat_y, bat_width)
  149. int bat_x, bat_y, bat_width;
  150. {
  151. int half_bat, i, w, x, y;
  152. y = bat_y;
  153. half_bat = bat_width/2+1;
  154. /* Shrink Bat */
  155. for (x=bat_x,w=bat_width;w>0;x++,w -= 2) {
  156. vz_line(x+1,y,x + w -1, y,1);
  157. vz_line(x,y+1,x + w, y+1,3);
  158. vz_plot(x,y,3);
  159. vz_plot(x+w, y,3);
  160. vz_plot(x-1,y,0);
  161. vz_plot(x-1,y+1,0);
  162. vz_plot(x+w+1,y,0);
  163. vz_plot(x+w+1,y+1,0);
  164. for (i=0;i<10;i++) {
  165. vz_sound(i+200-10*w,2);
  166. }
  167. }
  168.  
  169. bat_erase(bat_x,bat_y,bat_width);
  170. /* Explode Bat */
  171. for (x=0,y=61;x<half_bat;x++,y--) {
  172. vz_plot(bat_x+half_bat-x,bat_y,3);
  173. vz_plot(bat_x+half_bat-x,y,3);
  174. vz_plot(bat_x+half_bat,y,3);
  175. vz_plot(bat_x+half_bat+x,bat_y,3);
  176. vz_plot(bat_x+half_bat+x,y,3);
  177. for (i=0;i<200;i++) {}
  178. for (i=0;i<20;i++) {
  179. vz_sound(5+rand(10),1);
  180. }
  181. vz_plot(bat_x+half_bat-x,bat_y,0);
  182. vz_plot(bat_x+half_bat-x,y,0);
  183. vz_plot(bat_x+half_bat,y,0);
  184. vz_plot(bat_x+half_bat+x,bat_y,0);
  185. vz_plot(bat_x+half_bat+x,y,0);
  186. }
  187. if (lives) NL_Tune();
  188. ball_erase(ball_x,ball_y);
  189. ball_x = bat_x + (bat_width/2);
  190. ball_y = 60;
  191. y_ball_dir = -1;
  192. x_ball_dir = 1;
  193. bat_plot(bat_x,bat_y,bat_width);
  194. }
  195.  
  196. /* vz_score Display Routine */
  197. /* 0<=x<=26 0<=y<=59 0<=n<=32767 */
  198. Display_vz_score(x, y, n, l)
  199. int x, y, n, l;
  200. {
  201. int i, location;
  202. location = (32 * y) + x + 28672;
  203. if (l) vz_score(location + 5,0);
  204.  
  205. for (i = 4; n > 0 && i >= 0; i--)
  206. {
  207. location = (32 * y) + x + 28672;
  208. vz_score(location + i, (n % 10));
  209. n = n / 10;
  210. }
  211.  
  212. }
  213.  
  214. /* Draw the current Level to the screen */
  215. Display_Level(Lvl)
  216. char *Lvl;
  217. {
  218. char ltr;
  219. int i,x,y,location;
  220.  
  221. i=0; Destructable_Bricks = 0; Bricks_To_Destroy = 0;
  222. for (y=0;y<39;y += 4)
  223. {
  224. for (x=0;x<26;x += 2)
  225. {
  226. brick_type[i] = Lvl[i] -0x30;
  227. brick_x[i] = x * 4; brick_y[i] = y;
  228. if ((brick_type[i] < 9) && (brick_type[i] > 0)) Destructable_Bricks++;
  229. if (brick_type[i] == 8) silver[i] = 3;
  230. location = (32 * brick_y[i]) + x + 28672;
  231. brick(location,brick_type[i]);
  232. i++;
  233. }
  234. }
  235. Bricks_To_Destroy = Destructable_Bricks;
  236. }
  237.  
  238. draw_gamefield()
  239. {
  240. int x, y;
  241.  
  242. for (y=0;y<16;y++) {
  243. for (x=0;x<6;x++) {
  244. poke(28698 + 32 * y + x,85);
  245. }
  246. }
  247.  
  248. for (y=16;y<23;y++) {
  249. for (x=0;x<6;x++) {
  250. poke(28698 + 32 * y + x,255);
  251. }
  252. }
  253.  
  254. for (y=30;y<37;y++) {
  255. for (x=0;x<6;x++) {
  256. poke(28698 + 32 * y + x,255);
  257. }
  258. }
  259.  
  260. for (y=44;y<51;y++) {
  261. for (x=0;x<6;x++) {
  262. poke(28698 + 32 * y + x,255);
  263. }
  264. }
  265.  
  266. /* Arkaball Logo */
  267. vz_shape(104,1,8,7,2,"\x08\x08\x14\x14\x3e\x22\x77");
  268. vz_shape(112,1,8,7,2,"\x06\x02\x6a\x32\x23\x22\x77");
  269. vz_shape(120,1,8,7,2,"\x00\x00\xcc\x82\x0e\x92\x6d");
  270. vz_shape(104,9,8,6,3,"\x1e\x09\x0e\x09\x09\x1e");
  271. vz_shape(112,9,8,6,3,"\x00\x31\x08\x38\x48\x35");
  272. vz_shape(120,9,8,6,3,"\x88\x98\x88\x88\x88\xdc");
  273.  
  274. /* Hi */
  275. vz_shape(112,17,8,5,1,"\x57\x52\x72\x52\x57");
  276.  
  277. /* vz_score */
  278. vz_shape(104,31,8,5,1,"\x1d\x11\x1d\x05\x1d");
  279. vz_shape(112,31,8,5,1,"\xdd\x15\x15\x15\xdd");
  280. vz_shape(120,31,8,5,1,"\xdc\x50\xd8\x90\x5c");
  281.  
  282. /* Level */
  283. vz_shape(104,45,8,5,1,"\x11\x11\x11\x11\x1d");
  284. vz_shape(112,45,8,5,1,"\xd5\x15\x95\x15\xc9");
  285. vz_shape(120,45,8,5,1,"\xd0\x10\x90\x10\xdc");
  286. }
  287.  
  288. ball_erase(ball_x,ball_y)
  289. int ball_x, ball_y;
  290. {
  291. vz_plot(ball_x,ball_y,0);
  292. vz_plot(ball_x+1,ball_y,0);
  293. vz_plot(ball_x,ball_y+1,0);
  294. vz_plot(ball_x+1,ball_y+1,0);
  295. }
  296.  
  297. ball_plot(ball_x,ball_y)
  298. int ball_x, ball_y;
  299. {
  300. vz_plot(ball_x,ball_y,2);
  301. vz_plot(ball_x+1,ball_y,2);
  302. vz_plot(ball_x,ball_y+1,2);
  303. vz_plot(ball_x+1,ball_y+1,2);
  304. }
  305.  
  306. bat_erase(bat_x,bat_y, bat_width)
  307. int bat_x,bat_y,bat_width;
  308. {
  309. vz_line(bat_x,bat_y,bat_x + bat_width,bat_y,0);
  310. vz_line(bat_x,bat_y+1,bat_x + bat_width,bat_y+1,0);
  311. }
  312.  
  313. bat_plot(bat_x,bat_y,bat_width)
  314. int bat_x,bat_y,bat_width;
  315. {
  316. vz_line(bat_x+1,bat_y,bat_x + bat_width -1,bat_y,1);
  317. vz_line(bat_x,bat_y+1,bat_x + bat_width,bat_y+1,3);
  318. vz_plot(bat_x,bat_y,3);
  319. vz_plot(bat_x+bat_width,bat_y,3);
  320. }
  321.  
  322. /**************************************************************************
  323. * The main loop
  324. **************************************************************************/
  325. main(ac,av)
  326. int ac;
  327. char *av;
  328. {
  329. int dly;
  330. /* Define the Levels - Hoo BOY! This is huuuuuge */
  331. strcpy(Level0,"0000000000000888888888888855555555555554444444444444333333333333322222222222221111111111111");
  332. strcat(Level0,"000000000000000000000000000000000000000");
  333. strcpy(Level1,"1000000000000120000000000012300000000001234000000000123450000000012345600000001234567000000");
  334. strcat(Level1,"123456710000012345671200008888888888883");
  335. strcpy(Level2,"0000000000000666666666666611111111111115555555555555111111111111144444444444443331111111111");
  336. strcat(Level2,"222222222222211111111112220000000000000");
  337. strcpy(Level3,"0765840321760065843017658005843207658400843210658430043218058432003218408432100218430432180");
  338. strcat(Level3,"018432032184008432102184300432170184320");
  339. strcpy(Level4,"0001000001000000010001000000088888880000088288828800088888888888008888888888800888888888880");
  340. strcat(Level4,"080888888808008080000080800000880880000");
  341. strcpy(Level5,"0000000000000305060706050330506070605033050607060503305060706050330949494949033050607060503");
  342. strcat(Level5,"305060706050340409040904043050607060503");
  343. strcpy(Level6,"0000044500000000044556000000044556670000004556677000004556677110000556677112000006677112000");
  344. strcat(Level6,"000677112200000007112200000000012200000");
  345. strcpy(Level7,"0009090909000090000000009009909010909900000002000000000909390900000090040090000000005000000");
  346. strcat(Level7,"099090609099009000000000900009090909000");
  347. strcpy(Level8,"0000000000000009090009090000939000939000094900094900009990009990000000000000000000511160000");
  348. strcat(Level8,"000052226000000005333600000000544460000");
  349. strcpy(Level9,"0000000000000000000000000000900000200000090000212000009000213120000900213831200090002131200");
  350. strcat(Level9,"009000021200000900000200000099999999999");
  351. strcpy(Level10,"0000000000000088888888888008000000000800808888888080080800000808008080888080800808000008080");
  352. strcat(Level10,"080888888808008000000000800888888888880");
  353. strcpy(Level11,"9999999999999000090000090009109009009000900900900920090395090690009009009009000900904900900");
  354. strcat(Level11,"092090090090009000009000070999999999999");
  355. strcpy(Level12,"0000000000000077701110777006660222066600555033305550044404440444003330555033300222066602220");
  356. strcat(Level12,"011107770111000000000000000000000000000");
  357.  
  358. asm("di\n");
  359. mem = 0;
  360.  
  361. hivz_score = 2000;
  362.  
  363. vz_setbase(0x7000);
  364.  
  365. for (;;) {
  366.  
  367. Funky_Intro();
  368.  
  369. levelno = 0;
  370.  
  371. playervz_score = 0;
  372.  
  373. lives = 3;
  374.  
  375. vz_mode(1);
  376.  
  377. Init_Play();
  378.  
  379. Display_Lives(lives);
  380.  
  381. x_ball_dir = 1;
  382. y_ball_dir = 1;
  383.  
  384.  
  385. do {
  386.  
  387. Ball_Move();
  388.  
  389. Ball_Bounce();
  390.  
  391. Brick_Bounce();
  392.  
  393. Bat_Move();
  394.  
  395. Bat_Move();
  396.  
  397. for (dly=0;dly<200;dly++) {};
  398.  
  399. } while (lives);
  400.  
  401. ball_erase(ball_x,ball_y);
  402. draw_string(27, 40, 3, "G m O e ");
  403. draw_string(27, 40, 1, " a e v r");
  404. GO_Tune();
  405. for (j=0;j<100;j++) {dly = 50;
  406. do {
  407. dly--;
  408. } while(dly);
  409. };
  410. }
  411. }
  412.  
  413. Ball_Bounce()
  414. {
  415. /* Ball hit sides or top? */
  416. if ((ball_x + x_ball_dir <0) || (ball_x + x_ball_dir >102)) {x_ball_dir = -x_ball_dir; vz_sound(25,7);}
  417. if (ball_y + y_ball_dir <0) {y_ball_dir = -y_ball_dir; vz_sound(25,7);}
  418.  
  419. /* Ball hit bat? */
  420. if ((ball_y == 60) && (ball_x > bat_x -1) && (ball_x < bat_x + bat_width )) {y_ball_dir = -1; vz_sound(75,15);}
  421.  
  422. /* Hit edge of bat? */
  423. if ((ball_y == 60) && ((ball_x == bat_x - 1) || (ball_x == bat_x -2))) {
  424. if (ball_x<100) { ball_erase(ball_x,ball_y);ball_x-=2; }
  425. y_ball_dir = -1;
  426. x_ball_dir = -1;
  427. vz_sound(75,15);
  428. }
  429. if ((ball_y == 60) && ((ball_x == bat_x + bat_width ) || (ball_x == bat_x + bat_width +1))) {
  430. if (ball_x>2) { ball_erase(ball_x,ball_y);ball_x+=2;}
  431. y_ball_dir = -1;
  432. x_ball_dir = +1;
  433. vz_sound(75,15);
  434. }
  435. /* Oops! Dropped the ball! */
  436. if (ball_y > 60) {
  437. ball_erase(ball_x,ball_y);
  438. lives--; Display_Lives(lives);
  439. Player_Die(bat_x, bat_y, bat_width);
  440. }
  441. }
  442.  
  443. Brick_Bounce()
  444. {
  445. int startscan;
  446. if (ball_y <=6) startscan = 0;
  447. if ((ball_y > 6) && (ball_y <=10)) startscan = 13;
  448. if ((ball_y >10) && (ball_y <=14)) startscan = 26;
  449. if ((ball_y >14) && (ball_y <=18)) startscan = 39;
  450. if ((ball_y >18) && (ball_y <=22)) startscan = 52;
  451. if ((ball_y >22) && (ball_y <=26)) startscan = 65;
  452. if ((ball_y >26) && (ball_y <=30)) startscan = 78;
  453. if ((ball_y >30) && (ball_y <=34)) startscan = 91;
  454. if ((ball_y >34) && (ball_y <=38)) startscan = 104;
  455. if (ball_y >38) startscan = 117;
  456.  
  457. /* Hit a brick? */
  458. for (z=startscan;z<startscan+27;z++) {
  459.  
  460. if (brick_type[z]) {
  461.  
  462.  
  463. /* Hit bottom-left of brick? */
  464. if ((ball_y - 1 == brick_y[z] + 2) && (ball_x + 2 == brick_x[z]))
  465. { hitbrick = 1;
  466. brickhitno = z;
  467. y_ball_dir = +1; x_ball_dir = -1;
  468. ball_erase(ball_x,ball_y); ball_y += y_ball_dir; ball_x += x_ball_dir;
  469. }
  470.  
  471.  
  472. /* Hit bottom-right of brick? */
  473. if ((ball_y - 1 == brick_y[z] + 2) && (ball_x == brick_x[z] + 7))
  474. { hitbrick = 1;
  475. brickhitno = z;
  476. y_ball_dir = +1; x_ball_dir = +1;
  477. ball_erase(ball_x,ball_y); ball_y += y_ball_dir; ball_x += x_ball_dir;
  478. }
  479.  
  480. /* Hit top-left of brick? */
  481. if ((ball_y +2 == brick_y[z]) && (ball_x + 3 == brick_x[z]))
  482. { hitbrick = 1;
  483. brickhitno = z;
  484. y_ball_dir = -1; x_ball_dir = -1;
  485. ball_erase(ball_x,ball_y); ball_y += y_ball_dir; ball_x += x_ball_dir;
  486. }
  487.  
  488. /* Hit top-right of brick? */
  489. if ((ball_y +2 == brick_y[z]) && (ball_x == brick_x[z] + 7))
  490. { hitbrick = 1;
  491. brickhitno = z;
  492. y_ball_dir = -1; x_ball_dir = +1;
  493. ball_erase(ball_x,ball_y); ball_y += y_ball_dir; ball_x += x_ball_dir;
  494. }
  495.  
  496. /* Hit bottom of Brick? */
  497. if ((ball_y - 1 == brick_y[z] + 2) && (ball_x + 3 > brick_x[z]) && (ball_x < brick_x[z] + 7))
  498. { hitbrick = 1;
  499. brickhitno = z;
  500. y_ball_dir = +1;
  501. ball_erase(ball_x,ball_y); ball_y += y_ball_dir;
  502. }
  503.  
  504.  
  505. /* Hit Left of Brick? */
  506. if (!hitbrick) {
  507. if ((ball_x + 2 == brick_x[z]) && (ball_y + 1 > brick_y[z]) && (ball_y < brick_y[z] + 3))
  508. { hitbrick = 1;
  509. brickhitno = z;
  510. x_ball_dir = -1;
  511. ball_erase(ball_x,ball_y); ball_x += x_ball_dir;
  512. }
  513. }
  514.  
  515.  
  516. /* Hit right of Brick? */
  517. if (!hitbrick) {
  518. if ((ball_x - 1 == brick_x[z] + 6) && (ball_y + 3 > brick_y[z]) && (ball_y < brick_y[z] + 3))
  519. { hitbrick = 1;
  520. brickhitno = z;
  521. x_ball_dir = +1;
  522. ball_erase(ball_x,ball_y); ball_x += x_ball_dir;
  523. }
  524. }
  525.  
  526. /* Hit top of Brick? */
  527. if (!hitbrick) {
  528. if ((ball_y + 1 == brick_y[z]) && (ball_x + 3 > brick_x[z]) && (ball_x < brick_x[z] + 7))
  529. { hitbrick = 1;
  530. brickhitno = z;
  531. y_ball_dir = -1;
  532. ball_y += y_ball_dir; ball_erase(ball_x,ball_y);
  533. }
  534. }
  535.  
  536. }
  537. }
  538.  
  539. if (hitbrick) { hitbrick = 0;
  540.  
  541. if (brick_type[brickhitno] == 9) vz_sound(120,10);
  542. if (brick_type[brickhitno] == 8) {
  543. silver[brickhitno]--;
  544. if (!silver[brickhitno]) {
  545. vz_score_add(12);
  546. brick_erase(brickhitno);
  547. brick_type[brickhitno] = 0;
  548. Bricks_To_Destroy--;
  549. if (!Bricks_To_Destroy) {
  550. bat_erase(bat_x,bat_y);
  551. ball_erase(ball_x,ball_y);
  552. Level_Complete();
  553. }
  554. vz_sound(100,12);
  555. }
  556. else { vz_sound(130,10); }
  557. }
  558.  
  559. if ((brick_type[brickhitno] < 8) && (brick_type[brickhitno] > 0)) {
  560. brick_erase(brickhitno);
  561. Bricks_To_Destroy--;
  562. if (!Bricks_To_Destroy) {
  563. bat_erase(bat_x,bat_y);
  564. ball_erase(ball_x,ball_y);
  565. Level_Complete();
  566. }
  567. }
  568. /* Rand bonuses go in here */
  569. switch(brick_type[brickhitno]) {
  570. case 1: { vz_score_add(3); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  571. case 2: { vz_score_add(4); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  572. case 3: { vz_score_add(5); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  573. case 4: { vz_score_add(6); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  574. case 5: { vz_score_add(7); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  575. case 6: { vz_score_add(8); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  576. case 7: { vz_score_add(9); vz_sound(50,15); brick_type[brickhitno] = 0; break;}
  577. }
  578.  
  579. }
  580. }
  581.  
  582. Ball_Move()
  583. {
  584. ball_erase(ball_x,ball_y);
  585.  
  586. ball_x += x_ball_dir;
  587. ball_y += y_ball_dir;
  588.  
  589. ball_plot(ball_x,ball_y);
  590. }
  591.  
  592. Bat_Move()
  593. {
  594. if ((mem[0x68ef] & 0x20) == 0) /* left (M) ? */
  595. {
  596. if (bat_x > bat_x_min) {
  597. bat_erase(bat_x,bat_y,bat_width);
  598. bat_x--;
  599. bat_plot(bat_x,bat_y,bat_width);
  600. }
  601. }
  602. else
  603. if ((mem[0x68ef] & 0x08) == 0) /* right (,) ? */
  604. {
  605. if (bat_x < bat_x_max - bat_width) {
  606. bat_erase(bat_x,bat_y,bat_width);
  607. bat_x++;
  608. bat_plot(bat_x,bat_y,bat_width);
  609. }
  610. }
  611. else
  612. if ((mem[0x68bf] & 0x10) == 0) /* pause (p) ? */
  613. {
  614. do { }
  615. while ((mem[0x68ef] & 0x10) != 0); /* unpause (spc) ? */
  616. }
  617. if ((mem[0x68fe] & 0x10) == 0) /* quit (q) ? */
  618. {
  619. lives = 0;
  620. }
  621. }
  622.  
  623. Funky_Intro()
  624. {
  625. int x,y,bbb,dly,start;
  626. vz_mode(1);
  627.  
  628. Init_Intro();
  629.  
  630. /* Draw blocks */
  631. for (x=8;x<111;x+=14)
  632. {
  633. vz_line(x,top,x+12,top,2);
  634. vz_line(x,top,x,top+11,2);
  635. vz_line(x,top+12,x+12,top+12,2);
  636. vz_line(x+12,top,x+12,top+12,2);
  637. }
  638.  
  639. for (x=10;x<110;x+=14)
  640. {
  641. for (y=top+2;y<top+11;y++)
  642. {
  643. vz_line(x,y,x+8,y,2);
  644. }
  645. }
  646. start = 0;
  647. for (bbb=0;bbb<243;bbb++) {
  648. if ((inch() != 'S') && (!start)) ball_Bounce();
  649. else start =1;
  650. }
  651. vz_shape(bat_x,61,16,3,0,"\xff\xff\xff\xff\xff\xff");
  652. vz_shape(ball_x,ball_y,4,4,0,"\xff\xff\xff\xff");
  653. draw_string(19, 32, 3, "By Jason Oakley");
  654. draw_string(17, 42, 2, "Press S to Start");
  655. draw_string(40, 52, 1, "(C) 2000");
  656. do
  657. {
  658. } while ((inch() != 'S') && (!start));
  659. }
  660.  
  661.  
  662. ball_Bounce()
  663. {
  664. int dly;
  665. vz_shape(ball_x,ball_y,4,4,0,"\xff\xff\xff\xff");
  666.  
  667. if (ball_x > 123) { bbxdx = -bbxdx; vz_sound(25,7);}
  668. if (ball_y > 55) { bbydy = -bbydy;
  669. if (ball_x > 10) {vz_sound(120,10);}
  670. }
  671. if (ball_y < top+14) { bbydy = -bbydy;
  672. for (dly=100;dly>70;dly--) {vz_sound(dly,1);}
  673. letr++;
  674. Show_Letter(letr); }
  675.  
  676. ball_x +=bbxdx;
  677. ball_y +=bbydy;
  678.  
  679. vz_plot(ball_x+1,ball_y,2);
  680. vz_plot(ball_x+2,ball_y,2);
  681. vz_plot(ball_x,ball_y+1,2);
  682. vz_plot(ball_x+1,ball_y+1,2);
  683. vz_plot(ball_x+2,ball_y+1,1);
  684. vz_plot(ball_x+3,ball_y+1,2);
  685. vz_plot(ball_x,ball_y+2,2);
  686. vz_plot(ball_x+1,ball_y+2,2);
  687. vz_plot(ball_x+2,ball_y+2,2);
  688. vz_plot(ball_x+3,ball_y+2,2);
  689. vz_plot(ball_x+1,ball_y+3,2);
  690. vz_plot(ball_x+2,ball_y+3,2);
  691.  
  692. bat_Move();
  693. for (j=0;j<500;j++) {};
  694. }
  695.  
  696.  
  697.  
  698. bat_Move()
  699. {
  700. vz_shape(bat_x,61,16,3,0,"\xff\xff\xff\xff\xff\xff");
  701. if ((ball_x <117) && (ball_x > 5)) bat_x = ball_x-6;
  702.  
  703. vz_shape(bat_x,61,16,1,1,"\x3f\xfe");
  704. vz_shape(bat_x,62,16,2,3,"\x7f\xff\x7f\xff");
  705. vz_plot(bat_x+1,61,3);
  706. vz_plot(bat_x+15,61,3);
  707. }
  708.  
  709. Show_Letter(lett)
  710. int lett;
  711. {
  712. switch(lett) {
  713. case 1: {vz_shape(24,top+3,8,7,1,"\x7c\x22\x22\x3c\x24\x22\x73"); break;}
  714. case 2: {vz_shape(52,top+3,8,7,1,"\x08\x08\x14\x14\x3e\x22\x77"); break;}
  715. case 3: {vz_shape(80,top+3,8,7,1,"\x08\x08\x14\x14\x3e\x22\x77"); break;}
  716. case 4: {vz_shape(108,top+3,8,7,1,"\x70\x20\x20\x20\x20\x21\x7f"); break;}
  717. case 5: {vz_shape(94,top+3,8,7,1,"\x70\x20\x20\x20\x20\x21\x7f"); break;}
  718. case 6: {vz_shape(66,top+3,8,7,1,"\x7c\x22\x22\x3e\x21\x21\x7e"); break;}
  719. case 7: {vz_shape(38,top+3,8,7,1,"\x77\x22\x24\x38\x24\x22\x77"); break;}
  720. case 8: {vz_shape(10,top+3,8,7,1,"\x08\x08\x14\x14\x3e\x22\x77"); break;}
  721. }
  722. }
  723.  
  724. draw_string(x,y,color,src)
  725. int x,y,color;
  726. char *src;
  727. {
  728. while (*src)
  729. {
  730. char_draw(x,y,color,*src);
  731. x += 6;
  732. src++;
  733. }
  734. }
  735.  
  736. GO_Tune()
  737. {
  738. int dely;
  739. vz_sound(160,50);
  740. vz_sound(190,50);
  741. vz_sound(175,50);
  742. vz_sound(160,50);
  743. for (dely=0;dely<200;dely++) {};
  744. vz_sound(180,50);
  745. vz_sound(210,50);
  746. vz_sound(195,50);
  747. vz_sound(180,50);
  748. for (dely=0;dely<200;dely++) {};
  749. vz_sound(240,50);
  750. for (dely=0;dely<30;dely++) {};
  751. vz_sound(240,50);
  752. for (dely=0;dely<30;dely++) {};
  753. vz_sound(240,50);
  754. for (dely=0;dely<30;dely++) {};
  755. vz_sound(240,150);
  756. }
  757.  
  758. NL_Tune()
  759. {
  760. int dely;
  761. vz_sound(200,50);
  762. for (dely=0;dely<1000;dely++) {};
  763. vz_sound(200,50);
  764.  
  765. vz_sound(170,150);
  766. for (dely=0;dely<1000;dely++) {};
  767. vz_sound(170,50);
  768.  
  769. vz_sound(180,50);
  770.  
  771. vz_sound(210,50);
  772.  
  773. vz_sound(180,50);
  774.  
  775. vz_sound(200,150);
  776. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement