Page 3 of 4

Re: An Introduction to Programming, For beginners

Posted: Fri Jan 23, 2009 11:47 pm
by eatcomics
That's what I had thought I was wondering about that...

Re: An Introduction to Programming, For beginners

Posted: Mon Jan 26, 2009 1:29 pm
by Aeolus
So when is 16 coming out?

Re: An Introduction to Programming, For beginners

Posted: Fri Feb 06, 2009 8:45 pm
by eatcomics
Oh, my bad, remember I'm on two other chats as well lol :lol:

Re: An Introduction to Programming, For beginners

Posted: Tue Feb 10, 2009 2:00 pm
by dandymcgee
Ginto8 wrote::roll: You kinda missed my point. You'll have to wait until you get to operator overloading to understand. ;)
I knew what it meant.. I'm just saying we both said the same thing but you said it with actual code.

Re: An Introduction to Programming, For beginners

Posted: Tue Feb 10, 2009 3:42 pm
by Ginto8
dandymcgee wrote:
Ginto8 wrote::roll: You kinda missed my point. You'll have to wait until you get to operator overloading to understand. ;)
I knew what it meant.. I'm just saying we both said the same thing but you said it with actual code.
:lol: Oh, okay. ;)

Re: An Introduction to Programming, For beginners

Posted: Thu Mar 12, 2009 3:31 pm
by MarauderIIC
I split threads out from here.
User Input started by EvolutionXEngine
Outputting letters as numbers (a=0...) started by cplusplusnoob.
Please use those to continue any applicable discussion of those topics.

Re: An Introduction to Programming, For beginners

Posted: Fri Mar 13, 2009 7:43 pm
by MarauderIIC
Split another post out.
Random questions don't go here, please make your own thread.

Re: An Introduction to Programming, For beginners

Posted: Mon Apr 06, 2009 3:18 pm
by EvolutionXEngine
Sooo now I'm trying to learn C++ with the Dummies version... dam... anyways my complier is to executing this..
I copy and paste ..but it says their is an error and i can't figure it out...

Code: Select all

// BoolTest - compare variables input from the
// keyboard and store the results off
// into a logical variable
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char* pszArgs[])
{
// set output format for bool variables
// to true and false instead
// of 1 and 0
cout.setf(cout.boolalpha);
// initialize two arguments
int nArg1;
cout << “Input value 1: “;  <------------------------------------------------  I get the Error right here!
cin >> nArg1;
int nArg2;
cout << “Input value 2: “;
cin >> nArg2;
bool b;
b = nArg1 == nArg2;
cout << “The statement, “ << nArg1
<< “ equals “ << nArg2
<< “ is “ << b
<< endl;
// wait until user is ready before terminating program
// to allow the user to see the program results
system(“PAUSE”);
return 0;
}
please help , explain... Thank You!

Re: An Introduction to Programming, For beginners

Posted: Mon Apr 06, 2009 7:37 pm
by Ginto8
EvolutionXEngine: please use

Code: Select all

 brackets!
As for the error, can you tell us exactly what the compiler says? Going "OMG I HAS AN ERROR ON THIS LINE WHAT'S WRONG WITH IT????" doesn't help the people trying to help you. If you post the error, it gives your helpers clues as to what they have to look for. :)  ;) 

I haven't seen you around here before, so welcome to the forum! :mrgreen:

Re: An Introduction to Programming, For beginners

Posted: Sun Apr 26, 2009 6:46 pm
by EvolutionXEngine
Still im reading the C++ book but i want to get an idea of a game structure.
Can anyone help. Such as a 2d or 3d structure... some sort of chart!

Thanks!

Re: An Introduction to Programming, For beginners

Posted: Sun Apr 26, 2009 8:22 pm
by MarauderIIC
...feel free to make new threads for your issues. Please.

Re: An Introduction to Programming, For beginners

Posted: Sun Oct 25, 2009 12:37 pm
by zeid
Here's a very, simple representation of perhaps the most basic game setup you could have;
Image

You begin the program, and everything is initialised. Things like images that need to be loaded, models, level files. Anything that is too taxing to do in realtime and should be in memory from the games beginning should be done here.

After this you go into the Game Loop. This is basically a giant while(!exit) loop exit is a boolean that will equal true when it's ready to shutdown the game. Otherwise the loop cycles through infinitely.

A timer is used in almost all modern games to make each iteration of the loop sleepfor a short period. If this wasn't in place the game would run as fast as the computer allows it at all times, background processes would affect game speed and the game would run at different speeds on different supported hardware.

I mention the input logic inside the game loop, but this isn't neccassarily the case. It isn't uncommon for the input logic to be place in a seperate thread so that delays caused by the game running logic don't stop input from being registered. Although in most basic game circumstances you can just put the input in the game loop (Even if it's sloppy).

Here is the most important part of the game, the game logic. Technically speaking you can break this up into all kinds of things like physics, sound, etc. This is the core of the game, it is where all your collision detection updating object positions, creating new objects, etc. is handled. It is your games rules!

Rendering is done after all the game logic has been updated. As it's name suggests this is where you tell your game to get all the locations and states of your objects and render them accordingly. You clear the screen and redraw everything everytime you render.

After rendering has finished you check the state of exit if it changed to true during sometime in the game logic then you exit the game loop, otherwise you start it over again.

Clean-up, we don't want memory leaking, maybe we created a bunch of temp files that are only needed while the game is open for some reason. So after all is done it is important to clean-up allowing the player to close the game in piece without any negative repurcussions.

Thats a very broad and general outline of how a game is structured. People try and keep everything modular (e.g. the renderer, the physics, etc.) so that it can be easily read and that you can re-use parts easily. This is why there are physics engines, graphics engines, etc.

Re: An Introduction to Programming, For beginners

Posted: Sun Jan 03, 2010 11:37 am
by EdEown
What about C# ?
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P

Re: An Introduction to Programming, For beginners

Posted: Fri Feb 05, 2010 11:53 pm
by OmegaGDS
EdEown wrote:What about C# ?
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P
Have you heard of F#? Apparently it is being made by the same guy who made C#, and it will be better. I'm not even sure if the F# thing is true though, can someone confirm? For now, I thing Java and C++ will be the big ones in the future. well... scratch java.

Re: An Introduction to Programming, For beginners

Posted: Wed Feb 10, 2010 1:13 pm
by MrDeathNote
OmegaGDS wrote:
EdEown wrote:What about C# ?
Eaven if it is not popular so much...it has great potential for the future I think, at least it is made to improve C++.
Guild wars 2 team is using it for some specific stuf :P
Have you heard of F#? Apparently it is being made by the same guy who made C#, and it will be better. I'm not even sure if the F# thing is true though, can someone confirm? For now, I thing Java and C++ will be the big ones in the future. well... scratch java.
Yes there is a language called F#. It's a .Net language and it's not even close to new, it first appeared around 2002 although it isn't distributed yet it will be shipped with Visual Studio 2010 or so we're told...........