• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
#include<graphics.h>#include<stdlib.h>#include<stdio.h>#include<conio.h>#include<dos.h>#include<string.h>void score(int i){setcolor(10);settextstyle(2,0,1);outtextxy(25+i+5,(getmaxy())-25,"*");}void erase(int x){setcolor(9);settextstyle(2,0,1);outtextxy(25+x+5,(getmaxy())-25,"*");}void main(){/* select a driver and mode that supports *//* multiple background colors. */int gdriver = EGA, gmode = EGAHI, errorcode;int poly1[20],poly2[20],i,j,k,m=0,n=225,x,y,z,p;int poly[20],a=0,b,s=0;char ch,ans='y',msg[80];/* initialize graphics and local variables */initgraph(&gdriver, &gmode, "");/* read result of initialization */errorcode = graphresult();if (errorcode != grOk) /* an error occurred */{printf("Graphics error: %s\n", grapherrormsg(errorcode));printf("Press any key to halt:");getch();exit(1); /* terminate with an error code */}/* for centering text messages */settextjustify(CENTER_TEXT, CENTER_TEXT);x = getmaxx();// / 2;y = getmaxy();// / 2;setbkcolor(9);getch();/*score board*/setcolor(12);rectangle(5,y-55,105,y-5);rectangle(8,y-52,102,y-8);settextstyle(1,0,1);outtextxy(55,y-45,"SCORE");/*name*/settextstyle(2,0,4);outtextxy(x/2,y-10,"BY ARUN PRASANTH.B I-year ECE");
 
while(ans=='y'){/*bow*/j=5;i=5;setcolor(14);arc(5,25,315,45,45);line(5,25,39,3);line(5,25,39,47);setcolor(9);line(39,3,39,47);line(50,24,50,26);a=0;m=0;n=225;s=0;for(p=5;p<65;p=p+5){erase(p);}while(a<10){poly[0]=i+2; poly[1]=m+25;poly[2]=i; poly[3]=m+24;poly[4]=i+55; poly[5]=m+24;poly[6]=i+50; poly[7]=m+20;poly[8]=i+60; poly[9]=m+25;poly[10]=i+50; poly[11]=m+30;poly[12]=i+55; poly[13]=m+26;poly[14]=i; poly[15]=m+26;poly[16]=i+2; poly[17]=m+25;setcolor(4);setfillstyle(1,4);fillpoly(9,poly);m=m+25;a++;}/*baloon*/setcolor(10);setfillstyle(1,10);fillellipse(x-50,y-50,15,20);b=10;//getch();while(b>0){setcolor(4);setfillstyle(1,4);i=5;poly[0]=i+2; poly[1]=25;poly[2]=i; poly[3]=24;poly[4]=i+55; poly[5]=24;
 
poly[6]=i+50; poly[7]=20;poly[8]=i+60; poly[9]=25;poly[10]=i+50; poly[11]=30;poly[12]=i+55; poly[13]=26;poly[14]=i; poly[15]=26;poly[16]=i+2; poly[17]=25;fillpoly(9,poly);setcolor(14);line(5,25,39,3);line(5,25,39,47);for(k=y-50;k>0&&(!kbhit());k--){setcolor(10);setfillstyle(1,10);fillellipse(x-50,k,15,20);delay(15);setcolor(9);setfillstyle(1,9);fillellipse(x-50,k,20,20);}j=5;if(k==0&&b==1){setcolor(9);line(5,25,39,3);line(5,25,39,47);setcolor(14);line(39,3,39,47);line(50,24,50,26);}else if(k==0){setcolor(4);setfillstyle(1,4);fillpoly(9,poly);}else{for(i=5,z=k;i<x||z>0;z--,i=i+5){//if(z==0)//break;if(j<35){setcolor(14);line(j,25,39,3);line(j,25,39,47);}if(j==35){setcolor(14);line(39,3,39,47);line(50,24,50,26);}
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...