This is a project submitted by Priyanka R and Mamatha H of VI semester of 2012 pass-out batch.
This is a snapshot of the game in action:
You can download the source from here.
This is a snapshot of the game in action:
You can download the source from here.
Can u send the synopsis and report
ReplyDeleteCan u send the synopsis and report
ReplyDeletewhere is source code?? how to get it
ReplyDeleteClick on download from =>here<= this link
ReplyDeletecan u please tell me how to restart this game
ReplyDeletebecause each time we loose we have to debug it again
ReplyDeleteI check the comments section everyday and disappointed to find comments asking for report. Finally some sensible comment.
DeleteThe count of arrows fired becomes >15 and in counting function this is detected like this:
else if(count>=15)
{
sprintf(str,"NO of arrows:%d,NO OF ARROWS OVER GAME LOST",count);
bitmap_output(5,300,str,GLUT_BITMAP_TIMES_ROMAN_24);
glutIdleFunc(NULL);
}
If you observe the game lost message is displayed and idle function is made NULL. This stops the game loop. So you should reinitialize all variables in this piece of code. The flip side is the game will never end. You have to keep on playing. Is it OK?
or else can we use mouse call back and restart?
ReplyDeletevoid restart(int id)
ReplyDelete{
switch(id)
{
case 1: glutIdleFunc(id);
break;
break;
case 2 : exit(0);
break;
}
glutPostRedisplay();
}
will it work?
I didn't get why you defined restart? If you meant to use it as a mouse call back not advisable since you are using menu which is attached to right mouse button.
DeleteSo think what you want to do...
If you want after loosing to ask user wanna play again make him press 'R'(for restart)
else if(count>=15)
{
sprintf(str,"NO of arrows:%d,NO OF ARROWS OVER GAME LOST",count);
bitmap_output(5,300,str,GLUT_BITMAP_TIMES_ROMAN_24);
strcpy(str,"To Restart playing press R");
bitmap_output(5,300,str,GLUT_BITMAP_TIMES_ROMAN_24);
glutIdleFunc(NULL);
}
You can try to initialize all the variables like this in the keyboard function inside if k=='R' like this
void keys(unsigned char k,int r,int q)
{
if(k=='r')
glutIdleFunc(id1);
if(k=='R')
{
maxy=600; count=0; maxx=500; n=3; m=3;
count1=0;count2=0;count3=0;count4=0;count5=0;count6=0;count7=0;count8=0;count9=0;count10=0;
x=25;y=50;
glutIdleFunc(id);// move the arrow up
}
if(k=='q')
exit(0);
}
thankyou sir
DeleteAll the best for (exams)your and everyone who visited this blog... EXAMS
ReplyDeletehow to increase the speed of arrow......
ReplyDeleteif i increase value of m,n....speed increases,but it doesnt hits all target...need help
how to make arrows hit the targets . please explain the commands
ReplyDeleteCan u tell me frequency of sound during shooting ...
ReplyDelete