Category : C Source Code
Archive   : EGAGRAX.ZIP
Filename : MOVERS.C

 
Output of file : MOVERS.C contained in archive : EGAGRAX.ZIP
#include
#define PI128 3.141585/128.
char quit_string[] = "Hit any key to quit.";
char palete1[17] = { 0, 1, 58, 58, 62, 62, 62, 62, 4,
7, 4, 4, 4, 4, 4, 4, 0 } ;
/*This program draws a moving ball with animation done using the page
swapping method. It is speed limited by the necessity to swap only
during vertical retrace. */


double xs[256], ys[256];
main()
{
int x1, y1, x2, y2, i, icol, j;
double x, y;

setmod(16);
zsetup();
setpals(palete1);
setmask(15);
setdraw(0);
rectfill(0,0,639,349,0);
for (i = 0; i < 8; i++) {
rectfill(i*80, 0, i*80+19,349,1);
rectfill(i*80+40, 0 , i*80+59, 349,8);
}
for (i = 0; i < 20; i++) llettr(i*9, 16, quit_string[i], 9);
setdraw(1);
rectfill(0,0,639,349,0);
for (i = 0; i < 8; i++) {
rectfill(i*80, 0, i*80+19,349,1);
rectfill(i*80+40, 0 , i*80+59, 349,8);
}
for (i = 0; i < 20; i++) llettr(i*9, 16, quit_string[i], 9);
setmask(6);
x2=320;
y2=175;
for (i = 0; i < 256; i++) {
xs[i] = 320.-300.*sin(PI128*i);
ys[i] = 175.+100.*cos(PI128*i);
}
for (i = 0; !kbhit() ; i = (i+1) & 255 ) {
if( i & 1) {
setdisp(0);
setdraw(1);
} else {
setdisp(1);
setdraw(0);
}
while( !( inp(0x3da) & 8));
x= xs[i];
y= ys[i];
rectfill(x2-10,y2-9,x2+10,y2+9,0);
x2 = x1;
y2 = y1;
x1 = x;
y1 = y;
if(y1 > 175 && x1 >= 50 && x1 <= 130) icol = 2;
else icol = 4;
fillelip(x1,y1,10,8,icol);
}
setdisp(0);
setmod(3);
}


  3 Responses to “Category : C Source Code
Archive   : EGAGRAX.ZIP
Filename : MOVERS.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/