Jump to content


Game State Machine


2 replies to this topic

#1 Isoprog

    New Member

  • Members
  • PipPip
  • 11 posts

Posted 07 November 2009 - 10:51 PM

Hi,
Can someone tell me about a good tutorial or site, with the help of which, I can make a good usable game state machine? It does't matter what game engine it uses.

regards

#2 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1199 posts

Posted 08 November 2009 - 02:57 PM

I've never actually looked at someone else's code on that, but with any state machine it's usually just setting up some constants or enums and using a switch case. That would be in the main loop, so you change the game state and then it switches to main menu or level loops. Don't know what your programming level is, but you generally use the same idea for game entities. A door has an open or closed state. An enemy has idle, attack, etc. If it's more complicated then that, let me know.
Currently using Blender 2.5, FlashPunk, and Unity.

#3 Isoprog

    New Member

  • Members
  • PipPip
  • 11 posts

Posted 08 November 2009 - 05:52 PM

thanks, ok i have got some idea, and try to implement this. when i will stuck on something i will come back to ask further.

thanks
regards





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users