Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Jun 2012
Offline Last Active Nov 20 2012 08:40 AM

#5000250 beginning C++ game programming

Posted by on 12 November 2012 - 08:56 AM

IMHO, beginning with getting a firm grasp of the basics of C will help you in the long run when delving into C++. As for where to begin learning C++, I think that it's best to go for just a general knowledge of C++, then going to a specific area of programming style, such as game programming.

If you want a mixture of good knowledge of C++ as well as the basics for game programming, I'd recommend the book 'C++ Programming for the Absolute Beginner' by Mark Lee. It teaches you how C++ works just like a normal book would, but using game analogies and examples to teach you, so it's like hitting two birds with one stone.

However, it still stands that you should learn some C before C++. I started off messing around with C, in which I developed my first text-based game (which I got rid of last year). After that, I read the aforementioned book, and used the net to learn C++, and I'm in the process of making another text-based (soon to be 2D grapical! :D) game.

But still, you should just do what suits you best. All we can offer are pointers and advice. :)

#5000053 C++ - Is Goto a Good Practice?

Posted by on 11 November 2012 - 06:31 PM

I've made a simple little text-based game that implements an extremely primitive menu. For it, I have designed a small option menu for attacks. Before, it used to automatically move on to the opponent's attack if you happened to use the gun attack if you were out of ammo, so I fixed that by adding a goto function that reverts back to the option menu before the enemy initiates it's attack.

I've read in some places that goto is unreliable, and indeed, shouldn't be used in most cases. I was just curious as to specifically why this is, and what alternative could I use?