movie() { speed=501; ozcls(); ozsetactivepage(1); ozsetdisplaypage(0); ozcls(); for(x=0, y=79 ; y>20 ; x++, y--) { ozcls(); drawgun(); ozcircle(x,y,2,4|1); ozdelay(speed); ozswapactivedisplay(); } ozsetactivepage(0); ozsetdisplaypage(0); ozline(97,60,37,0,1); shatter(); /* movietext();*/ ozsetfont(FONT_OZ_LARGE); ozputs(119,20,"OZ Clay Pigeons"); ozsetfont(FONT_OZ_NORMAL); ozputs(0,70,"Press Any Key..."); speed=2501; ozngetch(); }
void puttextline(byte y) { static byte f; f=ozgetfont(); ozsetfont(myfont); ozputsf(y); ozsetfont(f); }
void set_edit_font(byte n) { extern byte xlat_override,do_grab_transl; static byte i; static byte f; switch(n) { case 1: xlat_override=0; do_grab_transl=32; f=FONT_PC_LARGE; /* font_narrow_height=line_height=13; line_height_bytes=13*30; lines_per_screen=80/13; */ break; case 0: xlat_override=0; do_grab_transl=32; f=FONT_PC_NORMAL; /* font_narrow_height=line_height=8; line_height_bytes=8*30; lines_per_screen=80/8; */ break; case 2: xlat_override=1; f=font2; break; case 3: xlat_override=1; f=font3; break; } ozsetappfont(f); ozsetfont(f); font_narrow_height=line_height=ozgetfontheight(f); line_height_bytes=(unsigned int)font_narrow_height*30; lines_per_screen=80/font_narrow_height; if(lines_per_screen>MAX_LINES_PER_SCREEN) lines_per_screen=MAX_LINES_PER_SCREEN; #ifdef TRANSL i=32; do { width_table[i]=measurechar(i); } while(++i); for(i=0;i<32;i++) { width_table[i]=measurechar(n<2?xlat_table[i]:i); } if(n==0) width_table[13]=6; /* CR fixup */ if(n>1) width_table[0]=width_table[127]; #else for(i=0;i<128;i++) width_table[i]=measurechar(i); #endif }
main() { ozgetauxsize(); ozclick(0); ozcls(); if(load==1) { loadconfig(); } if(mov==1) { if(watch==1) { movie(); watch=0; } } ozcls(); high=1; prevhigh=0; score=0; shots=25; hits=0; misses=0; acc=0; bullseyes=0; ozquiet(); ozsetfont(FONT_OZ_LARGE); ozputs(0,0,"OZ Clay Pigeons"); ozsetfont(FONT_OZ_NORMAL); ozputs(95,3,"Version 2.0"); ozputs(0,20,"(1) Play OZ Clay Pigeons"); ozputs(0,30,"(2) High Scores"); ozputs(0,40,"(3) Keys"); ozputs(0,50,"(4) Options"); ozputs(0,60,"(5) Quit OZ Clay Pigeons"); ozputs(130,20,"Made with Hi-Tech C;"); ozputs(130,30,"USE AT YOUR OWN RISK!"); ozputs(130,50,"Up/Dn arrows to select"); highlight(); main(); }
highscores() { sprintf(randspeed,""); sprintf(dreispeed,""); sprintf(zweispeed,""); sprintf(einspeed,""); ozcls(); ozputs(0,70,"Loading High Scores..."); if(loadhighscores(4)==-1) return; ozcls(); ozsetfont(FONT_OZ_LARGE); ozputs(0,0,"OZCP High Scores"); ozsetfont(FONT_OZ_NORMAL); ozputs(0,20,"Random Speed:"); ozputs(0,30,"3rd Speed:"); ozputs(0,40,"2nd Speed:"); ozputs(0,50,"1st Speed:"); ozputs(119,20,randspeed); ozputs(119,30,dreispeed); ozputs(119,40,zweispeed); ozputs(119,50,einspeed); ozputs(0,70,"R to reset scores, or any other key to continue."); switch(ozngetch()) { case 'r': { ozcls(); ozputs(0,70,"Deleting Highscores..."); unlink("ozcp20/highscore0"); unlink("ozcp20/highscore1"); unlink("ozcp20/highscore2"); unlink("ozcp20/highscore3"); sprintf(randspeed,""); sprintf(dreispeed,""); sprintf(zweispeed,""); sprintf(einspeed,""); break; } } }
keys() { ozcls(); ozsetfont(FONT_OZ_NORMAL); ozputs(0,0,"CONTROL KEYS:"); ozputs(0,10,"Left/Right Arrows: Switch gun positions"); ozputs(0,20,"Enter: Pull"); ozputs(0,30,"Space: Fire Gun"); ozputs(0,40,"H/Lower Menu Key: This screen"); ozputs(0,50,"MY PROGRAMS: Quit OZCP"); ozputs(0,60,"S: Toggle Sound"); ozputs(0,70,"ANY KEY TO CONTINUE..."); ozngetch(); main(); }
play() { ozcls(); ozsetactivepage(0); ozsetdisplaypage(0); ozcls(); if(shots<1) { ozcls(); ozputs(0,0,"Out of Bullets! Game Over!"); ozngetch(); exit(0); } ozsetfont(FONT_OZ_NORMAL); drawgun(); addtoscore(0); addtoshots(0); sprintf(bullseye,"Bullseyes: %ld",bullseyes); ozputs(170,60,bullseye); accuracy(170,70); getsound(); ozputs(0,70,soundstat); ozputs(0,30,"Press <ENTER> to pull, then <SPACE> to fire."); switch(ozgetch()) { case KEY_BACKLIGHT: oztogglelight(); break; case KEY_MYPROGRAMS: endgameswitch(); exit(0); case KEY_LOWER_ESC: endgameswitch(); main(); case KEY_LOWER_ENTER: pull(); break; case KEY_LEFT: gunpos=LEFT; break; case KEY_RIGHT: gunpos=RIGHT; break; case KEY_LOWER_MENU: help(); break; case 'h': help(); break; case 's': changesound(); break; case KEY_NEWLINE: ozsnap(); break; } play(); }