|
|
|
#include #include #include #include #include void main() { int g=200,flag=0,i,j,m,points=0,pt,b=1; char a; int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "f:\\tc\\bgi");
for(i=1;i<10;i++) { setcolor(15); line(400+i*10,422,400+i*10,380); settextstyle(0,1,1);
outtextxy(405+i*10,422,"¯"); outtextxy(405+i*10,373,"¯"); }
for(m=1;m<=10;m++) { ban(); setcolor(15); line(300,422,300,380); settextstyle(0,1,1); outtextxy(305,422,"¯"); outtextxy(305,373,"¯");
do { if(flag==0) { cir(g); g++; delay(7); if(g==400) flag=1; } if(flag==1) { cir(g); g--; delay(7); if(g==200) flag=0; }
} while(!kbhit());
// arrow1();
// arrow2(); getch();
ban(); setcolor(15); line(300,60,300,103); outtextxy(305,103,"¯"); outtextxy(305,60,"¯"); gotoxy(12,12);
if(g>296 && g<303) { points=points+1000; pt=1000; printf("PERFECT SHOT"); } else if (g>290 && g<310) { printf("GOOD SHOT"); points=points+500; pt=500; } else if(g>280 && g<320) { printf("BAD SHOT"); points=points+200; pt=200; } else if(g>270 && g<330) { points=points+50; pt=50; printf("VERY BAD SHOT"); } else if(g>260 && g<340) { points=points-100; pt=-100; printf("PLEASE CONTACT YOUR DOCTOR TO CHECK YOUR EYES"); } else { points=points-500; pt=-500; printf("PLEASE DON'T TRY THIS GAME AGAIN ,THIS GAME NOT MADE FOR YOU "); } delay(500); gotoxy(12,13); printf("YOU GET %d POINTS FOR THIS",pt); gotoxy(12,14); printf("PRESS ANY KEY TO CONTINUE...."); getch();
black(b); b++; gotoxy(12,14); printf(" "); gotoxy(12,13); printf(" "); gotoxy(12,12); printf(" "); setcolor(0); line(300,60,300,103); settextstyle(0,1,0); outtextxy(305,103,"¯"); outtextxy(305,60,"¯"); gotoxy(25,12); } gotoxy(25,12); printf("YOUR SCORE =%d\n",points); printf(" HIGH SCORE =10,000"); getch(); }
ban() { setcolor(4); line(230,430,370,430); line(290,404,310,404); arc(265,430,48,180,37); arc(335,430,0,130,37); return 0; }
rec() { setcolor(0); rectangle(100,200,300,300); return 0; }
cir(int g) { setcolor(0); setfillstyle(1,4); fillellipse(g,60,50,50); setfillstyle(1,2); fillellipse(g,60,40,40); setfillstyle(1,1); fillellipse(g,60,30,30); setfillstyle(1,12); fillellipse(g,60,20,20); setfillstyle(1,5); fillellipse(g,60,10,10); setfillstyle(1,3); fillellipse(g,60,3,3); return 0; } /* arrow1() { int i;
for(i=1;i<262;i++) { ban(); settextstyle(1,0,1); setcolor(15); line(300,422-i,300,380-i); settextstyle(0,1,1); outtextxy(305,423-i,"¯"); outtextxy(305,373-i,"¯"); if(i%2==0) delay(1); setcolor(0); line(300,422-i,300,380-i); settextstyle(0,1,1); outtextxy(305,423-i,"¯"); outtextxy(305,373-i,"¯"); } return 0; }*/ /* arrow2() { int i; for(i=1;i<58;i++) { settextstyle(1,0,1); setcolor(15); line(300,160-i,300,380-261-i); settextstyle(0,1,1); outtextxy(305,423-262-i,"¯"); if(i%2==0) delay(1); setcolor(0); line(300,160-i,300,380-262-i); settextstyle(0,1,1); outtextxy(305,423-261-i,"¯"); } return 0; } */ black(int b) { int i; for(i=1;i<=b;i++) { setcolor(0); line(400+i*10,422,400+i*10,380); settextstyle(0,1,1); outtextxy(405+i*10,422,"¯"); outtextxy(405+i*10,373,"¯"); } return 0; }
//I have developed this game its easy
|