/*------------------------------------------------------------------- DROP.C *** WATER DROP ANIMATION SEQUENCE *** Programmed By Amaury M. Valdes July 30, 1990 (C) Copyright 1990 Omega Software, Inc. All Rights Reserved This program will demostrate how to incorporate sprites created with "SPRED" and compiled with "DEFINE" both of which are included with the package. If you have any comments or suggestions please feel free to drop me a line. GOOD LUCK & ENJOY !!! COMPUSERVE: 73447,2273 or MAIL: Amaury Valdes 11 Myrtle Avenue Passaic, NJ 07055 --------------------------------------------------------------------*/ #include #include #include #include #define TRUE 1; #define FALSE 0; int DROP1[]={5,6,0,1,9,1,0,1,9,9,1,1,1,9,1,1,1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,0}; int DROP2[]={7,6,0,0,1,9,1,0,0,0,1,9,9,1,1,0,1,1,9,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0}; int DROP3[]={7,4,0,1,9,1,1,1,0,1,9,9,1,1,1,1,1,1,1,1,1,1,1,0, 0,1,1,1,0,0}; int DROP4[]={12,7,0,0,0,0,0,0,0,0,9,0,0,0,0,1,9,1,0,0,0,1,1,0, 0,0,0,0,0,1,0,0,0,1,0,0,9,1,1,9,0,0,0,0,0,0, 0,9,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,9, 9,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0}; int DROP5[]={22,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,1,0, 0,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,1,0,0, 0,0,0,9,9,1,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0}; void *image; int x,y,len,width,ch,cc; long size; int main(void) { init_graphics_system(); put(230,30,"WATER DROP ANIMATION",2); rectangle(260,50,350,200); pos_sprite(COPYRGHT,10,339); put(25,340,"OMEGA SOFTWARE, INC. Programmed By Amaury M. Valdes",14); while (!kbhit()) { pos_sprite(FAUCET1,302,72);delay(100); pos_sprite(FAUCET2,302,72);delay(100); pos_sprite(FAUCET3,302,72);delay(100); pos_sprite(FAUCET4,302,72);delay(100); pos_sprite(FAUCET1,302,72); animate_drop();delay(300); } closegraph(); _setcursortype(_NORMALCURSOR); return 0; } int init_graphics_system(void) { int gdriver,gmode,errorcode; /*------------------------------------------------------- INITIALIZE SYSTEM FOR EGA GRAPHICS ONLY !!! --------------------------------------------------------*/ gdriver=EGA; gmode=EGAHI; initgraph(&gdriver,&gmode,""); errorcode=graphresult(); if (errorcode!=0) { clrscr();color(4,0); printf("\nERROR: PROGRAM WILL ONLY WORK ON COMPUTERS \n"); printf(" WITH EGA GRAPHICS CAPABILITIES !!! \n"); color(7,0); exit(1); } return 0; } int animate_drop(void) { pos_sprite(DROP1,301,86); /* POSITION DROP @ X,Y */ size=imagesize(300,85,308,92); /* STORE IMAGE IN BUFFER */ image=malloc(size); /* USE HEAP SPACE */ if (size