3 Replies - 670 Views - Last Post: 03 July 2012 - 01:14 AM Rate Topic: -----

#1 Veie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 28-June 12

Game State Implementation

Posted 02 July 2012 - 02:19 PM

For a while now, I've been planning on writing a game in C++, but I am confused with the concept of game states. I don't understand how anything could get done in a loop that does the same thing over and over. Going for something as simple as making a menu. You could start out by fading it in from black, but then what? I'm just really confused and am wondering if someone could help me understand this concept which has been plaguing me for weeks.

Is This A Good Question/Topic? 0
  • +

Replies To: Game State Implementation

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: Game State Implementation

Posted 02 July 2012 - 06:24 PM

If you are confused about a loop or menu then don't even consider trying to architect a game. We don't want to see you get so frustrated you quit coding all together, and that is what happens when new coders take on huge project far beyond their skillset.

Stop trying to architect a program while you are still learning the basics of C/C++/C#. It just never works. Its like saying you are going to learn home architecting WHILE you hammer boards together without a blueprint, and try to learn both new skills at the same time.

First learn the language. Do a couple hundred tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.

Then later you can start architecting your own simple stuff. Build a calculator. Build a DVD library program. Etc. Stuff that doesn't involve the complexity of a game.

Then move up to games.



There are three routes people seem to take when learning programming.
  • Just start trying to create programs
  • Start taking apart other programs and try to figure out the language by reverse engineering
  • Follow a guided learning course (school or self-teaching books)


For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.


If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Mar 2012
Spoiler

Was This Post Helpful? 1
  • +
  • -

#3 Veie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 28-June 12

Re: Game State Implementation

Posted 02 July 2012 - 06:34 PM

I'm not learning the language or anything like that. I have had other projects before and have written a couple of games, but they do not implement the state design and I can't find resources to do so. For a small game I have recently finished, I am trying to optimize it with this game state design. Does anyone know of any good books or sites?
Was This Post Helpful? 0
  • +
  • -

#4 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 1010
  • View blog
  • Posts: 4,214
  • Joined: 14-February 08

Re: Game State Implementation

Posted 03 July 2012 - 01:14 AM

You could check out tutorial 4 of my SDL tutorials linked in my signature. That should be of some use to you :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1