| | |
C++ game?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
Is it possible to make a very simple game with C++? any good sites to read up on how to do it? I have a program called Dev-C++. any kind of tips or code that i should know? I'm am just a noob at C++. I wish to play with it before I attend a computer programing camp during this summer. thanks
Owner/PC Technician of:
The PC Doctor
"If we can't fix it, it's just not fixable"
The PC Doctor
"If we can't fix it, it's just not fixable"
•
•
Join Date: Mar 2004
Posts: 5
Reputation:
Solved Threads: 0
Of course it is possible. I've been thinking about making a command-line (text) based RPG with C++. What you could do is say, create some bad guys, create a menu of what the user can do to them, randomize some attacks and etc... It will take a lot of function work but yes it could be done. I don't know of any good sites that provide basic game info. But there are lots of OpenGL sites and advanced sites. But you won't make a 3D game by this summer so I'd stick with command line stuff.
C/C++ is a fully functional language, you make the computer do virtually ANYTHING you want. The limitations of the language can be overcome with experience and skills.
BTW: 73.2 % of all games on the market are created in C/C++ in cluding popular titles such as Warcraft 3, and Diablo 2.
BTW: 73.2 % of all games on the market are created in C/C++ in cluding popular titles such as Warcraft 3, and Diablo 2.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
•
•
Join Date: Mar 2004
Posts: 5
Reputation:
Solved Threads: 0
I just wrote a small game in C++. I also have the source code to a few RPG games. It actually isn't that hard to make a console RPG. And as BountyX said, funny you should ask if games could be made in C++ because almost all games are. So you've picked the right language! You wouldn't want Java or C# as much because they are slower languages.
•
•
Join Date: Mar 2004
Posts: 28
Reputation:
Solved Threads: 0
i wrote it a while ago but anyways...
Dice Game
<< moderator edit: added [code][/code] tags >>
Dice Game
C++ Syntax (Toggle Plain Text)
/* Name: Dice Game Author: Bleek Description: Game Date: N/A Copyright: N/A */ #include <iostream> #include <time.h> #include <cstdlib> #include <windows.h> using namespace std; void one(); void two(); void three(); void four(); void five(); void six(); //Declare Functions used int main() { short unsigned int score = 0; short unsigned int compScore = 0; short unsigned int num = 0; short unsigned int num2 = 0; short unsigned int compNum = 0; short unsigned int compNum2 = 0; short unsigned int sum = 0; short unsigned int compSum = 0; char letter; //Declare Variables srand(time(NULL)); //Initialize random number generator system("title Joe's Dice Game"); while (letter != 'q') { cout << "Your Score: " << score << endl; cout << "computer's Score: " << compScore << endl << endl; cout << "Press r to roll or q to quit: "; cin >> letter; num = 1 + rand() % (6 - 1 + 1); num2 = 1 + rand() % (6 - 1 + 1); compNum = 1 + rand() % (6 - 1 + 1); compNum2 = 1 + rand() % (6 - 1 + 1); //Random numbers sum = num + num2; compSum = compNum + compNum2; //Calculate Sums if (letter == 'q') break; if (letter != 'r') { system("cls"); continue; } switch (num) { case 1: one(); break; case 2: two(); break; case 3: three(); break; case 4: four(); break; case 5: five(); break; case 6: six(); break; default: cout << "Error..."; break; } //end switch switch (num2) { case 1: one(); break; case 2: two(); break; case 3: three(); break; case 4: four(); break; case 5: five(); break; case 6: six(); break; default: cout << "Error..."; break; } //end switch cout << endl << "Yours: " << num << ", " << num2 << endl; cout << "Computer's: " << compNum << ", " << compNum2 << "\n\n"; //Display dice and numbers if (sum > compSum) { cout << "You won!!" << endl << endl; score++; } else { compScore++; cout << "you lost..." << endl << endl; } //Calculate score system("pause"); system("cls"); if (score == 12) { MessageBox(0, "You Won!!!", "Results:", MB_ICONEXCLAMATION); break; } if (compScore == 12) { MessageBox(0, "You lost...", "Results:", MB_ICONEXCLAMATION); break; } } return 0; } void one() { cout << " -----" << endl; cout << "| |" << endl; cout << "| O |" << endl; cout << "| |" << endl; cout << " -----" << endl; } void two() { cout << " -----" << endl; cout << "| O|" << endl; cout << "| |" << endl; cout << "|O |" << endl; cout << " -----" << endl; } void three() { cout << " -----" << endl; cout << "| O|" << endl; cout << "| O |" << endl; cout << "|O |" << endl; cout << " -----" << endl; } void four() { cout << " -----" << endl; cout << "|O O|" << endl; cout << "| |" << endl; cout << "|O O|" << endl; cout << " -----" << endl; } void five() { cout << " -----" << endl; cout << "|O O|" << endl; cout << "| O |" << endl; cout << "|O O|" << endl; cout << " -----" << endl; } void six() { cout << " -----" << endl; cout << "|O O|" << endl; cout << "|O O|" << endl; cout << "|O O|" << endl; cout << " -----" << endl; }
![]() |
Similar Threads
- looking for C++ London 3D Game Porgrammers - Growing proffessional startup company (Software Development Job Offers)
- Motion Behavior Engineer - C++ - Game Engine (Software Development Job Offers)
- News Story: Palin and Obama kick ass in Mercenaries 2 game (Game Development)
- Roblox seeks Game and Graphics Guru (Software Development Job Offers)
- game programmer needed (Software Development Job Offers)
- Ajax Game Developer Needed for a small project (Web Development Job Offers)
- News Story: Wall Street Best Bet? Video Game Makers (Game Development)
Other Threads in the C++ Forum
- Previous Thread: C++ arrays
- Next Thread: Alternatives to arrays?
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





