C++ game?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2003
Posts: 183
Reputation: viperman224 is an unknown quantity at this point 
Solved Threads: 1
viperman224's Avatar
viperman224 viperman224 is offline Offline
Junior Poster

C++ game?

 
1
  #1
Apr 6th, 2004
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"


Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 5
Reputation: Creator is an unknown quantity at this point 
Solved Threads: 0
Creator Creator is offline Offline
Newbie Poster

Re: C++ game?

 
1
  #2
Apr 6th, 2004
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 8
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: C++ game?

 
0
  #3
Apr 6th, 2004
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.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 5
Reputation: Creator is an unknown quantity at this point 
Solved Threads: 0
Creator Creator is offline Offline
Newbie Poster

Re: C++ game?

 
0
  #4
Apr 7th, 2004
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 2
Reputation: Tempus is an unknown quantity at this point 
Solved Threads: 0
Tempus Tempus is offline Offline
Newbie Poster

Re: C++ game?

 
1
  #5
Apr 7th, 2004
You can now get the original Quake source files (C++) and see what a full game looks like.

Check the website for it. Its released under the GNU rules.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 28
Reputation: Bleek is an unknown quantity at this point 
Solved Threads: 0
Bleek Bleek is offline Offline
Light Poster

Re: C++ game?

 
1
  #6
Apr 8th, 2004
i have my first game code of a dice game you can look at if you would like. ill post it if you reply back, it displays the dice using characters... its simple but i like it.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 183
Reputation: viperman224 is an unknown quantity at this point 
Solved Threads: 1
viperman224's Avatar
viperman224 viperman224 is offline Offline
Junior Poster

Re: C++ game?

 
0
  #7
Apr 8th, 2004
I would be glad to take a look at it
Owner/PC Technician of:

The PC Doctor
"If we can't fix it, it's just not fixable"


Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 8
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: C++ game?

 
0
  #8
Apr 9th, 2004
post is please
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 2
Reputation: Tempus is an unknown quantity at this point 
Solved Threads: 0
Tempus Tempus is offline Offline
Newbie Poster

Re: C++ game?

 
0
  #9
Apr 13th, 2004
Honestly, you really should use C#. Its alot more fun.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 28
Reputation: Bleek is an unknown quantity at this point 
Solved Threads: 0
Bleek Bleek is offline Offline
Light Poster

Re: C++ game?

 
0
  #10
Apr 13th, 2004
i wrote it a while ago but anyways...
Dice Game

  1. /*
  2.   Name: Dice Game
  3.   Author: Bleek
  4.   Description: Game
  5.   Date: N/A
  6.   Copyright: N/A
  7. */
  8.  
  9. #include <iostream>
  10. #include <time.h>
  11. #include <cstdlib>
  12. #include <windows.h>
  13. using namespace std;
  14. void one();
  15. void two();
  16. void three();
  17. void four();
  18. void five();
  19. void six();
  20. //Declare Functions used
  21. int main()
  22. {
  23. short unsigned int score = 0;
  24. short unsigned int compScore = 0;
  25. short unsigned int num = 0;
  26. short unsigned int num2 = 0;
  27. short unsigned int compNum = 0;
  28. short unsigned int compNum2 = 0;
  29. short unsigned int sum = 0;
  30. short unsigned int compSum = 0;
  31. char letter;
  32. //Declare Variables
  33. srand(time(NULL));
  34. //Initialize random number generator
  35. system("title Joe's Dice Game");
  36. while (letter != 'q')
  37. {
  38. cout << "Your Score: " << score << endl;
  39. cout << "computer's Score: " << compScore << endl << endl;
  40. cout << "Press r to roll or q to quit: ";
  41. cin >> letter;
  42. num = 1 + rand() % (6 - 1 + 1);
  43. num2 = 1 + rand() % (6 - 1 + 1);
  44. compNum = 1 + rand() % (6 - 1 + 1);
  45. compNum2 = 1 + rand() % (6 - 1 + 1);
  46.  
  47. //Random numbers
  48.  
  49. sum = num + num2;
  50. compSum = compNum + compNum2;
  51.  
  52. //Calculate Sums
  53.  
  54. if (letter == 'q')
  55. break;
  56. if (letter != 'r')
  57. {
  58. system("cls");
  59. continue;
  60. }
  61.  
  62. switch (num)
  63. {
  64. case 1:
  65. one();
  66. break;
  67. case 2:
  68. two();
  69. break;
  70. case 3:
  71. three();
  72. break;
  73. case 4:
  74. four();
  75. break;
  76. case 5:
  77. five();
  78. break;
  79. case 6:
  80. six();
  81. break;
  82. default:
  83. cout << "Error...";
  84. break;
  85. } //end switch
  86.  
  87. switch (num2)
  88. {
  89. case 1:
  90. one();
  91. break;
  92. case 2:
  93. two();
  94. break;
  95. case 3:
  96. three();
  97. break;
  98. case 4:
  99. four();
  100. break;
  101. case 5:
  102. five();
  103. break;
  104. case 6:
  105. six();
  106. break;
  107. default:
  108. cout << "Error...";
  109. break;
  110. } //end switch
  111.  
  112. cout << endl << "Yours: " << num << ", " << num2 << endl;
  113. cout << "Computer's: " << compNum << ", " << compNum2 << "\n\n";
  114.  
  115. //Display dice and numbers
  116.  
  117. if (sum > compSum)
  118. {
  119. cout << "You won!!" << endl << endl;
  120. score++;
  121. }
  122. else
  123. {
  124. compScore++;
  125. cout << "you lost..." << endl << endl;
  126. }
  127.  
  128. //Calculate score
  129.  
  130. system("pause");
  131. system("cls");
  132.  
  133. if (score == 12)
  134. {
  135. MessageBox(0, "You Won!!!", "Results:", MB_ICONEXCLAMATION);
  136. break;
  137. }
  138. if (compScore == 12)
  139. {
  140. MessageBox(0, "You lost...", "Results:", MB_ICONEXCLAMATION);
  141. break;
  142. }
  143. }
  144. return 0;
  145. }
  146.  
  147. void one()
  148. {
  149. cout << " -----" << endl;
  150. cout << "| |" << endl;
  151. cout << "| O |" << endl;
  152. cout << "| |" << endl;
  153. cout << " -----" << endl;
  154. }
  155. void two()
  156. {
  157. cout << " -----" << endl;
  158. cout << "| O|" << endl;
  159. cout << "| |" << endl;
  160. cout << "|O |" << endl;
  161. cout << " -----" << endl;
  162. }
  163. void three()
  164. {
  165. cout << " -----" << endl;
  166. cout << "| O|" << endl;
  167. cout << "| O |" << endl;
  168. cout << "|O |" << endl;
  169. cout << " -----" << endl;
  170. }
  171. void four()
  172. {
  173. cout << " -----" << endl;
  174. cout << "|O O|" << endl;
  175. cout << "| |" << endl;
  176. cout << "|O O|" << endl;
  177. cout << " -----" << endl;
  178. }
  179. void five()
  180. {
  181. cout << " -----" << endl;
  182. cout << "|O O|" << endl;
  183. cout << "| O |" << endl;
  184. cout << "|O O|" << endl;
  185. cout << " -----" << endl;
  186. }
  187. void six()
  188. {
  189. cout << " -----" << endl;
  190. cout << "|O O|" << endl;
  191. cout << "|O O|" << endl;
  192. cout << "|O O|" << endl;
  193. cout << " -----" << endl;
  194. }
<< moderator edit: added [code][/code] tags >>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC