2 Replies - 271 Views - Last Post: 02 May 2013 - 09:11 AM Rate Topic: -----

#1 Mylo  Icon User is offline

  • Knows all, except most.

Reputation: 265
  • View blog
  • Posts: 747
  • Joined: 11-October 11

Proper implementation of States

Posted 02 May 2013 - 02:03 AM

Hi

I will be implementing a state system into my game. I'm more so confused about WHERE to apply it. About every link I've read implements the state manager in a game engine/application class or a class doing a similar thing.

They all seem to have an Intro, Menu, GamePlay, Pause state, more or less.

However, you will clearly have objects in you're game, a Player, a Tree etc. Should these have there own state managers too? A player could be idle and so forth. If this is the case, and if in any case an object should need multiple states, how would that be handled?

Or is it only to be applied to what was mentioned above?

Is This A Good Question/Topic? 0
  • +

Replies To: Proper implementation of States

#2 aaron1178  Icon User is offline

  • Dovakiin, Dragonborn
  • member icon

Reputation: 169
  • View blog
  • Posts: 1,301
  • Joined: 22-October 08

Re: Proper implementation of States

Posted 02 May 2013 - 02:25 AM

Well on the current project I am working on, I have a 'Gamestate', which manages if the game is in 'Pause', 'Menu' or 'Gameplay' state. If the state is in 'Pause', it will stop gameplay, and show the pause menu. If it's in 'gameplay', it will render the objects in the scene, and other things like Physics and animation ect.

When I will create my players, trees objects and all that, I will be creating a another state manager to manage what state the players animation is in, what action is being executed, and what type of action it is.

I've found a few link on state manages as bellow:

http://gamedevgeek.c...me-states-in-c/
http://cecilsunkure....te-manager.html

But really, you can setup your state manager(s) however you want, you just need to think outside the box on these systems.
Was This Post Helpful? 3
  • +
  • -

#3 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 1009
  • View blog
  • Posts: 4,199
  • Joined: 14-February 08

Re: Proper implementation of States

Posted 02 May 2013 - 09:11 AM

Check out my tutorials linked in my signature :)
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1