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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a list in c++ stl?

689


Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.

2307


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

1773


What does stl stand for in basketball?

637


What is stl language?

669






What are the components of stl?

615


When did c++ add stl?

726


If P is the population on the first day of the year, B is the birth rate, and D is the death rate, the estimated population at the end of the year is given by the formula: The population growth rate is given by the formula: B – D Write a program that prompts the user to enter the starting population, birth and death rates, and n, the number of years. The program should then calculate and print the estimated population after n years. Your program must have at least the following functions: 1. growthRate: This function takes its parameters the birth and death rates, and it returns the population growth rate. 2. estimatedPopulation: This function takes its parameters the current population, population growth rate, and n, the number of years. It returns the estimated population after n years Your program should not accept a negative birth rate, negative death rate, or a population less than 2. please answer my question ....

1771


What is stl stand for?

734


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1970


What are the symptoms of stl?

599


What is stl stack?

658


a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.

1371


What is the use of stl?

632


What is a standard template library (stl)? What are the various types of stl containers?

667