Gaming Programming

I know this might be a half ass question but, I need to learn some stuff for game engines, and just plain game programming. I want to make a game like "I see you" (Basically just a easy short pix-elated game). I already have a program for the art, just I want to learn how to make hallways, doors, then a monster kill the player. But again I need to learn everything about basic programming in C++. Some basic examples of programming would be much appreciated.Like:
Code:
Something
something
/Code
Then what it does, thank you.
And also if you could list some terminology that would also be very appreciated.
Last edited on
I don't think you would use a game engine for something like that.. game engines are for like 3d games or big games I believe you could use SDL for simple graphics or even just make a simple console game like snake where you don't even need graphics you can just use characters to get started with. If there is a will there is a way anything is possible in c++.
You have to crawl before you can walk/run. If you want to skip right to game design get a program that lets you design a game around a template. But if you want to build your own game you need to know enough about programming to work with a programming language. Do the tutorial on this site, it'll probably take a month or two. Then move on from there. Maybe in a year you could make a 3d game if you work at it every day and are good at math.
closed account (zb0S216C)
johnc445 wrote:
"I need to learn some stuff for game engines"

2-D or 3-D engines? or engines in general? Based on the game you referenced, you're looking at a 3-D game engine, in which case, you're looking at a time-consuming project. I don't mean to sound demotivating, but it's the truth, especially when you know very little about C++. While games and their counterparts, engines, are normally implemented in C++, other languages can be used too such as C# (XNA) or Java.

johnc445 wrote:
"just plain game programming."

Define "plain game programming."

gitblit wrote:
"I don't think you would use a game engine for something like that.. game engines are for like 3d games or big games"

I wouldn't go so far as to disregard an engine as the base of a basic 2-D game. Naturally, a commercial 3-D game-engine like Unreal, CryENGINE and id Tech, are more complex from an architectural stand-point in comparison to a 2-D game-engine.

agnophilo wrote:
"and are good at math."

Not necessarily. There are libraries out there, like Direct-X, that have mathematical utilities for graphic artists -- one could use those utilities until they are proficient with mathematics enough to implement their own maybe.

Wazzak
Last edited on
You have to crawl before you can walk


^^^^


get a book on programming basics in C++. also the new boston C++ tutorial on youtube is great if you need a visual on how to do things. and the tutorial on this site is an excellent reference to C++.



Ok thank you for all the responses! But I want to build an engine, I don't want to use a program, I want to do this from the ground up! So I will look around this site, but if you know a tut for building a game from the ground up that has the basics, please send it to me.
Ok guys, I am using notepad plus plus and whenever I try to open the program it just brings up the coding. I save it as a .cpp but it doesn't work. Please help.
closed account (zb0S216C)
You need to compile the source code to generate a working program. For this, you need a compiler. There are many compilers out there, but for now, I would suggest using the MinGW compiler which is shipped with Code::Blocks[1].

[1]http://www.codeblocks.org/

Wazzak
Ok I am back! Since I have went online, did some tutorials, forgot everything, then remembered this site, I just decided that I want to use code blocks, and gimp for one small game. If anyone could link me a tutorial, or direct to a certain forum thread that would be much appreciated!
Ok I meant gimp by A 2d game, all the texturing will be from gimp, so all replays will be appreciated, thank you!
An example of a simple game...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <iostream>
#include <ctime>
#include <string>

using namespace std;

//a function that displays the results.
void results(string playerpick, string comppick, string a, string b, string c) {
	cout << endl;
	if(playerpick == "rock") {
		if(comppick == "rock") {
			cout << "It's a tie. " << endl;
		}
		if(comppick == "paper") {
			cout << b << "The computer wins. " << endl;
		}
		if(comppick == "scissors") {
			cout << a << "You win! " << endl;
		}
	}
	if(playerpick == "paper") {
		if(comppick == "paper") {
			cout << "It's a tie. " << endl;
		}
		if(comppick == "scissors") {
			cout << c << "The computer wins. " << endl;
		}
		if(comppick == "rock") {
			cout << b << "You win! " << endl;
		}
	}
    if(playerpick == "scissors") {
		if(comppick == "scissors") {
			cout << "It's a tie. " << endl;
		}
		if(comppick == "rock") {
			cout << a << "The computer wins. " << endl;
		}
		if(comppick == "paper") {
			cout << c << "You win! " << endl;
		}
	}
}

//The main part of the game. Note the function is outside of main.
int main() {

	srand ( time(NULL)); //This is needed for creating random events.

	string playerpick;  //A list of string variables.
	string comppick;
	string rock = "Rock breaks scissors. ";
	string paper = "Paper covers rock. ";
	string scissors = "Scissors cuts paper. ";
	string gameon = "yes";

	while (gameon == "yes") { //Starts the game loop.
		cout << "Choose 'rock', 'paper', or 'scissors'. ";
		cin >> playerpick;
		cout << endl;
		while(playerpick != "rock" && playerpick != "paper" && playerpick != "scissors") { //This enforces player options.
		    cout << "Type either 'rock', 'paper', or 'scissors'. ";   
		    cin >> playerpick;
			cout << endl;
	    }

	int randnum = rand() %3; //Here is the random draw.
	switch (randnum) {
	  case 0:
		  comppick = "rock";
		  cout << "The computer choose rock. " << endl;
		  break;
	  case 1:
		  comppick = "paper";
		  cout << "The computer choose paper. " << endl;
		  break;
	  case 2:
		  comppick = "scissors";
		  cout << "The computer choose scissors. " << endl;
		  break;
	  default:
		  cout << "Error";
	}
	
	results(playerpick, comppick, rock, paper, scissors);

	cout << endl << "Do you want to play again? yes/no? ";
	cin >> gameon;
	cout << endl;
	while(gameon != "yes" && gameon != "no") {
		    cout << "Enter either 'yes' or 'no'. ";   
		    cin >> gameon;
			cout << endl;
	    }
	
	system("cls"); //This clears the screen. Very bad form though.
	}
	
	return 0;
}


good luck to you johnc445. Don't let anyone tell you that you can't do it your own way.
Ok is this text based? And also i need help with codeblocks, something about compiling? I don't know anything about it please help.
closed account (N36fSL3A)
Obviously this game is text based.

Don't worry about game programming just yet, once you know C++ enough, start making text based games and then move on to graphical applications.
code blocks compiles just like any other IDE..press the build/run option.
Now that I have done some research, looked up a herrendous amount of tutorials, I have a very basic understanding of cpp. But I don't know how to Clear Screen.
Is it system ("Cls")?
Just tell me what the command is.
That is for windows. However, it is not recommended to use system("anything"). You can use \b for a backspace and \r to clear a line.
Do you think I could make a function so it will say "Press enter to continue" and it goes to the \r command? If you know any batch like:
:start
echo.
echo Press "Enter" to continue.
echo.
set /p Enter=
if %Enter% equ (Enter Key I guess?) goto \r
if %Enter% neq Enter goto start
Topic archived. No new replies allowed.