i think ill learn how to use c++ jsut caus ei can, thanks man
CPLUSPLUSGame Development
>.<
... this is simply too hard to understand ... <-- newbie
The game was pretty simple, but the part about game protection I found really interesting... It's too bad I couldn't thankyou while you were still here.
Just one thing, can you download this compiler on Ubuntu Linux? +can I use gEdit.
Yeh there's a version for Linux. Wth is gEdit?
Dude you use system("pause").... i dont remember very well but in a forum it says the system("pause") only works on Windows and its EVIL, if you ask me why its evil..Dont do it cause i forgot... why not go to cplusplus.com - The C++ Resources Network and search in the forums "Why system pause is evil" or something like that and you will see...(FIRST IT SAYS, it is OS dependant so i think it will work on windows only, AND NEXT it says it beats up security :/) ALSO why not use a simple code at the end:
Code:
//before this you should make 2 spaces down...so it looks decent //like after you finish the last code so it goes to the finishing place just put //<<endl<<endl; example cout << "GREAT you beated the game"<<endl<<endl; cout << "Press ENTER key to finish the game" cin.ignore(); // you will need to press ENTER key for it to jump to return 0 code return 0; // closes console =D
re. System("pause") it's Indeed windows/dos only and VERYresource intensive
where a simple getch() or cin.get() would do the job as well.
I think a lot of people use it because whatever tutorial/book they followed had it and it 'makes sense' to them ("Oh it pauses the program!").
where a simple getch() or cin.get() would do the job as well.
I think a lot of people use it because whatever tutorial/book they followed had it and it 'makes sense' to them ("Oh it pauses the program!").
That took a lot of typing I appreciate but ;
i guess i didnt understand a bit
i guess i didnt understand a bit
There are lots of tutorials can be available for the game development in C++ . From these tutorials you can learn lot of things which it can be performed the game and also lots of suggestion is also require for the tutorials .
i got none of this. But im going to try and study this. i want to be able to code and make hacks for games sometime.
Its very interesting to me and i know how to work a pc well. (fixing it, making games work and finding out how to fix errors.)
It would be cool to know how to code at age 15
Its very interesting to me and i know how to work a pc well. (fixing it, making games work and finding out how to fix errors.)
It would be cool to know how to code at age 15
[php]
#include <iostream>
using namespace std;
int uhp = 100;
int usp = 10;
int mp = 100;
int ms = 10;
int turn = 1;
int atk;
int dmg;
int main() {
system("title GameName");
while ( uhp > 0 ) {
if ( turn == 1 ) {
turn--;
for(;usp > 0
{
cout<<"It is YOUR turn hero.\n";
cout<<"Your HP is: "<<uhp<<"\n";
cout<<"Your SP is: "<<usp<<"\n";
cout<<"Decide Your Next Move\n";
cout<<"1. Punch(10 DMG 0 SP)\n";
cout<<"2. Psyki(20 DMG 5 SP)\n";
cin>>atk;
system("cls");
if ( atk == 1 ) {
dmg = 10;
cout<<"You do: "<<dmg<<" DMG\n";
mp = mp - dmg;
cout<<"Monster Life: "<<mp<<"\n";
}
else {
usp = usp - 5;
dmg = 20;
cout<<"You do: "<<dmg<<" DMG\n";
mp = mp - dmg;
cout<<"Monster Life: "<<mp<<"\n";
}
if ( turn == 0 ) {
turn++;
cout<<"Computer AIs Turn\n";
cout<<"Computer Hits You\n";
cout<<"Suffer: 10 Damage\n";
uhp = uhp - 10;
cout<<"New HP: "<<uhp<<"\n";
}
}
cout<<"It is YOUR turn hero.\n";
cout<<"Your HP is: "<<uhp<<"\n";
cout<<"You have run out of SP.\n";
cout<<"Decide your next move!\n";
cout<<"1. Punch(10 DMG 0 SP)\n";
cout<<"2. Recover SP\n";
cin>>atk;
system("cls");
if ( atk == 1 ) {
dmg = 10;
cout<<"You do: "<<dmg<<" DMG\n";
mp = mp - dmg;
cout<<"Monster Life: "<<mp<<"\n";
}
else {
usp = usp + 5;
cout<<"Monster Life has not changed: "<<mp<<"\n";
}
if ( turn == 0 ) {
turn++;
cout<<"Computer AIs Turn\n";
cout<<"Computer Hits You\n";
cout<<"Suffer: 10 Damage\n";
uhp = uhp - 10;
cout<<"New HP: "<<uhp<<"\n";
}
if ( mp < 5 ) {
cout<<"You Just Won\n";
system("pause");
exit(0);
}
}
}
cout<<"Thanks For Playin\n";
system("pause");
}
[/php]
Can not use pskik if you have less than 5 SP, can recover SP if you have less than 5 SP.
I'm sure there is an easier way to go about doing this, but I'm half asleep so yeah...
And no, this isn't a bump... it's a stickied topic
#include <iostream>
using namespace std;
int uhp = 100;
int usp = 10;
int mp = 100;
int ms = 10;
int turn = 1;
int atk;
int dmg;
int main() {
system("title GameName");
while ( uhp > 0 ) {
if ( turn == 1 ) {
turn--;
for(;usp > 0
{cout<<"It is YOUR turn hero.\n";
cout<<"Your HP is: "<<uhp<<"\n";
cout<<"Your SP is: "<<usp<<"\n";
cout<<"Decide Your Next Move\n";
cout<<"1. Punch(10 DMG 0 SP)\n";
cout<<"2. Psyki(20 DMG 5 SP)\n";
cin>>atk;
system("cls");
if ( atk == 1 ) {
dmg = 10;
cout<<"You do: "<<dmg<<" DMG\n";
mp = mp - dmg;
cout<<"Monster Life: "<<mp<<"\n";
}
else {
usp = usp - 5;
dmg = 20;
cout<<"You do: "<<dmg<<" DMG\n";
mp = mp - dmg;
cout<<"Monster Life: "<<mp<<"\n";
}
if ( turn == 0 ) {
turn++;
cout<<"Computer AIs Turn\n";
cout<<"Computer Hits You\n";
cout<<"Suffer: 10 Damage\n";
uhp = uhp - 10;
cout<<"New HP: "<<uhp<<"\n";
}
}
cout<<"It is YOUR turn hero.\n";
cout<<"Your HP is: "<<uhp<<"\n";
cout<<"You have run out of SP.\n";
cout<<"Decide your next move!\n";
cout<<"1. Punch(10 DMG 0 SP)\n";
cout<<"2. Recover SP\n";
cin>>atk;
system("cls");
if ( atk == 1 ) {
dmg = 10;
cout<<"You do: "<<dmg<<" DMG\n";
mp = mp - dmg;
cout<<"Monster Life: "<<mp<<"\n";
}
else {
usp = usp + 5;
cout<<"Monster Life has not changed: "<<mp<<"\n";
}
if ( turn == 0 ) {
turn++;
cout<<"Computer AIs Turn\n";
cout<<"Computer Hits You\n";
cout<<"Suffer: 10 Damage\n";
uhp = uhp - 10;
cout<<"New HP: "<<uhp<<"\n";
}
if ( mp < 5 ) {
cout<<"You Just Won\n";
system("pause");
exit(0);
}
}
}
cout<<"Thanks For Playin\n";
system("pause");
}
[/php]
Can not use pskik if you have less than 5 SP, can recover SP if you have less than 5 SP.
I'm sure there is an easier way to go about doing this, but I'm half asleep so yeah...
And no, this isn't a bump... it's a stickied topic

im just beginning to learn c++ and i must say, at first i didnt understand a word you where saying and now i understand the most of it and i do know what to do with it
thanks for the code!!!
thanks for the code!!!
thanks!it is usefoul

