Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


i want a road rash 3d game code if some one know please help
me



i want a road rash 3d game code if some one know please help me..

Answer / kapil

#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<process.h>
#include<stdlib.h>

void enemycar(int x, int y)
{
setcolor(15);
rectangle(x+1,y,x+49,y+100);
rectangle(x+1,y+25,x+49,y+75);
setfillstyle( SOLID_FILL,YELLOW);
floodfill((x+x+50)/2,(y+y+100)/2,15);
setfillstyle(1,YELLOW);
floodfill((x+x+50)/2,(y+y+40)/2,15);
floodfill((x+x+50)/2,(y+y+160)/2,15);

}

void mycar(int x, int y)
{
setcolor(15);
rectangle(x+1,y,x+49,y+100);
rectangle(x+1,y+25,x+49,y+75);
setfillstyle(5,RED);
floodfill((x+x+50)/2,(y+y+100)/2,15);
setfillstyle(2,BLUE);
floodfill((x+x+50)/2,(y+y+40)/2,15);
floodfill((x+x+50)/2,(y+y+160)/2,15);
}



void myclear(int x,int y)
{
setcolor(8);
rectangle(x+1,y,x+49,y+100);
rectangle(x+1,y+25,x+49,y+75);
setfillstyle(SOLID_FILL,8);
floodfill((x+x+50)/2,(y+y+100)/2,8);
floodfill((x+x+50)/2,(y+y+40)/2,8);
floodfill((x+x+50)/2,(y+y+160)/2,8);
}


void enemyclear(int x,int y)
{
setcolor(8);
rectangle(x+1,y,x+49,y+100);
rectangle(x+1,y+25,x+49,y+75);
// line(x+1,y,x+1,y+100);
// delay(500);
}

void main()
{
int gdriver = DETECT,gmode;
initgraph(&gdriver,&gmode,"C:\Turboc3\BGI");

int x=300,y=350,ch,life=3,score=0;
char choice;
cout<<"




* THUNDER RACER *";
cout<<"
---------------";
delay(2000);
cout<<"

Long long ago in Delhi, the Martians attacked the VBPS & the";
delay(2000);
cout<<"

enemies were defeated. Every student and citizen was";
delay(2000);

cout<<"

killed except the beautiful princess of Kapil and you";
delay(2000);
cout<<"

friend of Kapil survived.Kapil sent you to save her :) . Enemies want to kill her and she is in your :p ";
delay(2000);
cout<<"

car right now. If you have the guts save her from enemies'";
delay(2000);
cout<<"

cars and reach to Kapil.";
delay(2000);
cout<<"

So all the best...";
delay(20000);
for(int m=1;m<25;m++)
for(int n=1;n<80;n++) {
gotoxy(n,m);
cout<<" ";
}
setcolor(RED);
rectangle(20,60,200,120);
rectangle(20,300,200,420);
gotoxy(5,21);
cout<<"Only Aditya & Anshul";
gotoxy(5,22);
cout<<"have saved her till";
gotoxy(5,23);
cout<<"now. So you can be";
gotoxy(5,24);
cout<<"the 3-rd";
rectangle(249,0,401,getmaxy());
setfillstyle(SOLID_FILL,8);
floodfill(325,getmaxy()/2,RED);
setcolor(RED);
rectangle(20,200,200,250);
gotoxy(5,15);
cout<<"Press <Esc> to Exit";
for(int level=1;(level<=5)&&(life>0);level++){
if(level==1){
gotoxy(5,5);
cout<<"Your War Starts Now";
gotoxy(5,7);
cout<<"All the best";
delay(500);
gotoxy(5,5);
cout<<" ";
gotoxy(5,7);
cout<<" ";
}
else {
gotoxy(5,5);
cout<<"Next level.";
delay(500);
gotoxy(5,5);
cout<<" ";
}
for(int i=0;(i<15)&&(life>0);i++) {
if((level==5)&&(i==14)){
gotoxy(5,5);
cout<<"You have won";
gotoxy(5,6);
cout<<"Wanna continue <y/n>";
choice = getch();
if ((choice=='y')||(choice=='Y'))
main();
else
exit(0);
}
setcolor(RED);
rectangle(420,125,600,175);
gotoxy(55,10);
cout<<"Level = "<<level;
rectangle(420,250,600,300);
gotoxy(55,18);
cout<<"Lives = "<<life;
rectangle(420,350,600,400);
gotoxy(55,24);
cout<<"Score = "<<score;
int accident=0;
int y1=1,x1=250+((rand()%3)*50);
int y2=1,x2=250+((rand()%3)*50);
score += 10;
while(y1<getmaxy()-1)
{

enemyclear(x1,y1);
enemyclear(x2,y2);
y1++;
y2++;
if(accident == 1)
break;
enemycar(x1,y1);
enemycar(x2,y2);
mycar(x,y);
delay(5-level);
if(kbhit())
{
mycar(x,y);
ch=getch();
switch(ch) {
case 27: exit(0);
break;
case 75:myclear(x,y);
if(x>250)
x=x-50;
if((x==x1)||(x==x2))
if( ( ((y-y1)<100)&&((y-y1)>0) ) || ( ((y-y2)<100)&&((y-y2)>0) ) )
{
accident=1;
x=x+50;
mycar(x,y);
goto Next1;
}
mycar(x,y);
break;
case 77:myclear(x,y);
if(x<350)
x=x+50;
if((x==x1)||(x==x2))
if( ( ((y-y1)<100)&&((y-y1)>0) ) || ( ((y-y2)<100)&&((y-y2)>0) ) )
{
accident=1;
x=x-50;
mycar(x,y);
goto Next1;
}
mycar(x,y);
break;
case 72:myclear(x,y);
if(y>0)
y=y-5;
mycar(x,y);
break;
case 80:myclear(x,y);
if(y<getmaxy()-105)
y=y+5;
mycar(x,y);
break;
}
}
if((x==x1)||(x==x2))
if( ( ((y-y1)<100)&&((y-y1)>0) ) || ( ((y-y2)<100)&&((y-y2)>0) ) )
accident=1;



Next1:
if(accident==1){
life =life-1;
score -= 10;
if(life==0) {
gotoxy(5,5);
cout<<"GAME OVER ";
gotoxy(5,6);
cout<<"You could not save";
gotoxy(5,7);
cout<<"her";
break;
}
gotoxy(5,5);
cout<<"You have lost 1 life";
delay(500);
gotoxy(5,5);
cout<<" ";
}
}
}
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More STL Interview Questions

How connect plc and pc through software

0 Answers  


what is an algorithm in terms of STL?

1 Answers   Lucent, Wipro,


why we are using the fork command?.. how it works?

1 Answers  


Write a program in C++ to concatenate two strings into third string using pointers

5 Answers  


Who wrote stl?

0 Answers  


What do you mean by stl?

1 Answers  


Is string part of stl?

0 Answers  


What is Object Oriental Progam

2 Answers  


What is the STL?

2 Answers   Epson, HP,


Question 1)Read the data from one file and remove all the duplicated words and generate an output file containg only using words.Program should also print number of occurance of each words on standard output.(Program must be use STL and iostream object). Question 2)Write a program to convert the lower case contents of file to upper case using STL. Question 3)What is the output of this problem. int i=12; int &r =i; r+r/4; int +p =&r; int *p = &r; P+=r; return 1; Answer :a)12 b)17 c) 30 d)24 E)15 Question 4) #include #include #include void main() { char srcstr[30],desstr[30]; int i,len; clrscr(); cout<<"\nenter the string\n"; cin>>srcstr; len=strlen(srcstr); for(i=0;srcstr[i]!='\0';i++) { desstr[--len]=srcstr[i]; } desstr[i]='\0'; cout<<"\nreversed string is\n"; for(i=0;desstr[i]!='\0';i++) { cout< } getch(); } Answer : A) string output b)tuptuo gnirts c) string d)output Question 5) Class Test { static const Tk=LEN; int q; public: foo(intx =LEN):q(x){}; TGet Q() const { return q:} void call test Foo<long :9> foo(10); std::const<< foo.Getq(); Answer: 7,8,9,10,11 question 6) class A { int a; char b; }; class B:public A { char b; int a; }; What is the size? Answer a)5 bytes for class A and 5 bytes class B b)4 bytes for class A and 8 bytes class B. c).... d)....

2 Answers   Bally Technologies,


Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .

4 Answers   Zycus Infotech,


Assume I have a linked list contains all of the alphabets from "A" to "Z?" I want to find the letter "Q" in the list, how does you perform the search to find the "Q?"

2 Answers  


Categories