Members BookmarksPolls Fresher Jobs Funny Photos B.Tech Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

Advertisements


website counter



Arrow target game in C


Posted Date: 28 May 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: Avdhut Sonpethkar       Member Level: Gold
Rating:     Points: 1



#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




Responses

Author: Twinkle    28 May 2008Member Level: Gold   Points : 2
Thanks, I will try.


Author: Krishnan C    28 May 2008Member Level: Silver   Points : 2
very complicated


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Google PageCreator
Previous Resource: Do you know printf if yes then check this
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources


Contact Us    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.