Professional Documents
Culture Documents
College of Engineering
Computer Engineering Department
RPG Game
In Partial Fulfillment
of the Requirement of the Subject
Computer Fundamentals and Programming
Presented by:
Schedule:
TTH / 10:30-1:30 / CL2
Presented to:
Date Submitted
09-05-2019
I. Description of the Project
The project is called RPG game. It is a role playing game. Is a genre of video game where
the gamer controls a fictional character (or characteristics) that undertakes a quest in an
imaginary world. Defining RPGs is very challenging due to the range of hybrid genres that have
RPG elements.
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#include <conio.h>
#include <windows.h>
#include <stdio.h>
return 0;
}
void intro()
{
}
else if(race==2)
{ Beep(500,500);
cout<<"He is a half elf he doesn't have magic #BamBoozled'";
maxhp+=5,def+=4,att+=9,hp+=maxhp;
cout<<"Your hp is="<<maxhp<<"\nYour Defense
is="<<def<<"\nYour Attack is="<<att<<endl;
}
else
{
cout<<"Invalid race please input again";
goto choose;
}
instruct();
getch();
}
int menu()
{
int x=0, y=0;
system("cls");
for (int y=0; y<30; y++)
{
cout << title[y]<< endl;
}
cin>>answer;
if(answer==1)
{
system("cls");
Beep(500,500);
intro();
}
else if(answer==2)
{ Beep(500,500);
credits();
}
else if(answer==3)
{ Beep(500,500);
Jordan();
}
else if(answer==4)
{ Beep(500,500);
IIII();
}
else
Beep(600,500);
Beep(500,500);
cout<<"choose again\n\n\n";
goto choose;
answer=0;
cout<<answer;
return 0;
void menu2()
{
system("cls");
int answer;
choose:
cin>>answer;
if(answer==1)
{ Beep(500,500);
system("cls");
intro();
else
Beep(600,500);
Beep(500,500);
cout<<"choose again\n";
goto choose;
void Jordan()
{
system("cls");
cout<<"Labyu ";
system("pause");
menu2();
}
void credits()
{ system("cls");
cout<<"Members:\nJohn Cichon\nIris Fernandez\nDoli Lapu-os\nQuayd
Tabago\n #4 is reality\n";
system("pause");
menu2();
}
void tangent()
{
switch(sine)
case 'a':
{ Beep(500,0);
cout<<"help me";
case 'b':
cout<<"kill me";
case 'c':
{
cout<<"stay away";
break;
}
}
if(kbhit())
{
menu2();
}
}
void meme()
{
cout<<"hi";
system("pause");
menu2();
}
void move()
{
system("cls");
switch(map[y][x])
{
case'@':
{
if(GetAsyncKeyState(VK_UP) !=0)
{
int y2 = (y-1);
switch(map[y2][x])
{
case' ':
{
map[y][x]=' ';
map[y2][x]='@';
}
break;
case 'x':
{
map[y][x]=' ';
y-=1;
map[y2][x]='@';
rawr();
}
break;
case 'T':
{
map[y][x]='T';
y-=1;
map[y2][x]='@';
town();
}
break;
case 'G':
{
map[y][x]='G';
y-=1;
map[y2][x]='@';
menu();
}
break;
case 'S':
{
map[y][x]=' ';
y-=1;
map[y2][x]='@';
Shrine();
}
case 'B':
{
map[y][x]=' ';
y-=1;
map[y2][x]='@';
BOSS();
}
case '#':
{
map[y][x]=' ';
y-=1;
map[y2][x]='@';
}
break;
case 'x':
{
map[y][x]=' ';
y+=1;
map[y2][x]='@';
rawr();
}
break;
case 'T':
{
map[y][x]=' ';
y+=1;
map[y2][x]='@';
towns+=1;
town();
}
break;
case 'S':
{
map[y][x]=' ';
y+=1;
map[y2][x]='@';
Shrine();
}
case 'B':
{
map[y][x]=' ';
y+=1;
map[y2][x]='@';
BOSS();
}
map[y2][x]='@';
sveme();
}
}
}
else if(GetAsyncKeyState(VK_RIGHT)
!=0)
{
int x2 = (x+1);
switch(map[y][x2])
{
case' ':
{
map[y][x]=' ';
x+=1;
map[y][x2]='@';
}
break;
case 'x':
{
map[y][x]=' ';
x+=1;
map[y][x2]='@';
rawr();}break;
case 'T':
{
map[y][x]='T';
map[y][x2]='@';
x2+=1;
towns+=1;
town();
}
break;
case 'S':
{
map[y][x]=' ';
x+=1;
map[y][x2]='@';
Shrine();
}
case 'B':
{
map[y][x]=' ';
x+=1;
map[y][x2]='@';
BOSS();
map[y][x2]='@';
sveme();
}
}
}
else if(GetAsyncKeyState(VK_LEFT) !=0)
{
int x2 = (x-1);
switch(map[y][x2])
{
case' ':
{
map[y][x]=' ';
x-=1;
map[y][x2]='@';
}
break;
case 'x':
{
map[y][x]=' ';
x-=1;
map[y][x2]='@';
rawr();
}
break;
case 'T':
{
map[y][x]='T';
map[y][x2]='@';
x2-=1;
towns+=1;
town();
}
break;
case 'S':
{
map[y][x]=' ';
x-=1;
map[y][x2]='@';
Shrine();
}
case 'B':
{
map[y][x]=' ';
x-=1;
map[y][x2]='@';
sveme();
}
}
}
}
}
}
}Sleep(Gamepseed);
}
void rawr()
{
system("cls");
cout<<"enemy Attack";
Sleep(500);
int enmhp=(1+rand()%10)*(Level*5), enmatt=(att+(kills*Level));
int hitGoblin;
maxhp==(Level*20);
att=(att+att*Level)+(S*20),def=(def+(def*Level));
again:
srand(time(0));
if (enmhp>0)
{
shoot:
system("cls");
cout<<"Your hp:"<<hp<<"enemy hp"<<enmhp;
cout << "\nAction \n1.)Attack 3.)Defend\n2.)Item
4.)Act\n";
cin >> hitGoblin;
if(hitGoblin==1)
{
enmhp-=(att*(1+rand()%(10*Level)));
cout << "\nYou hit the goblin.\n"<<att;
cout << "The goblin now has " << enmhp << "HP
left.\n\n";
cout << "The goblin hit you back.\n";
cout << "You now have " << hp << "HP left.\n\n";
system("pause");
if (enmhp<=0)
{
}
hp-=(enmatt+(1+rand()%10*kills));
cout << "The goblin hit you back.\n";
cout << "You now have " << hp << "HP left.\n\n";
if(hp<=0)
{
cout<<"\nyou Died\n";
system("pause");
Endgame == true;
menu2();
}
else if(enmhp>0)
{
goto shoot;
}
}
else if(hitGoblin==3)
{
cout << "You chose not to hit and heal but the goblin hit
you instead\n";hp+=att;
cout << "You now have " << hp << "HP left.\n\n";
if (hp>maxhp)
{
hp-=(hp-maxhp);
}
goto shoot;
}
else if(hitGoblin==2)
{ chois:
int item;
system("cls");
cout<<"1.)Magical infinite
potion\n2.)MightyEnema3.)return?";
cin>>item;
if (item==1)
{
cout<<"This will replenish your
health!\nWill you use it?\n 1.)Yes\n2.)No";
int item2;
cin>>item2;
if (item2=1)
{
hp+=maxhp;
item2=0;
}
else
cout<<"Invalid answer";
system("pause");
else
{
cout << "That is not a valid choice.\n\n";
goto shoot;
}
}
}
void town()
{
again:
system("cls");
cout<<"Welcome to our humble town";Sleep(200);
int choice;
cout<<"What can i do for you today?\n 1.)Quest\n2.)Shop\n3.)Talk\n4.)Leave";
cin>>choice;
if (choice==1)
{
questing();
}
else if(choice==2)
{
shop();
}
else if(choice==3)
{
chatter();
}
else if (choice==4)
{
maingm();
}
else
{
cout<<"invalid action";
goto again;
}
}
int maingm()
{
system("pause");
while (stopgame== false)
}
else if (B==1)
{
if(TRUTH!=1)
{
cout<<"You have
saved the world though have you learned who you are?\n";
system("pause");
cout<<"\nShrines are
the key!";
system("pause");
return 0;
}
}
}
}
}
int questing()
{
if (q==1)
{
cout<<"\nYou must kill 3 demons\n";
system("pause");
if (kills>=3)
{
Level+=1;
q+=1;
cout<<"JFBUT wEhre thhei eben demons?";
sleep(1000);
system("cls");
cout<<"Level up!!!!";
maingm();
}
}
else if(q==2)
{
cout<<"You must visit 3 towns\n";
if (towns>=3)
{
}
}
void instruct()
{
}
else if(answer!=1)
{
cout<<"You have failed this test";
system("pause");
maingm();
}
}
system("pause");
}
void BOSS()
{
cout<<"Lol";
system("pause");
maingm();
}
void shop()
{
cout<<"lol";
maingm();
}
void chatter()
{
cout<<"lol";
maingm();
}Example: