| Ultrashock Forums
• FenoFSM - Finite State Machine Framework |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||
Ultrashock Member Comments:
|
2009-06-26
#2 |
||
|
|
2009-06-29
#3 |
||
|
Oh, I forgot to tell what the framework can be used for. Sorry about that ![]() You can use the state machine to control an entire system's flow. Take a Flash website for example. Different states can represent different scenes, and state transitions represent the transitions among scenes. You can listener for the State.ENTER event to set up the entering transition of a scene and State.EXIT for exiting transition. A state transition's delay can be set to be infinite. When the Transition.INIT event is dispatched, the system can load/prepare for the upcoming scene; after the preparation is done, you can call the Transition.go() method to continue the transition, making the system enter a new scene. Also, the same can be applied to a game system. States can represent different scenes like main menu, game character selection, actual gameplay, pause menu, etc. And as you said, this framework can be used on game characters. Say your character enters attack mode from idle mode when the player inputs the attack command through keyboard, you can create two states representing the attack and idle modes and one transition in-between, which is triggered by the "attack input". I hope this helps you get the idea
|
|
|
2009-06-29
#4 |
||
|
Yeah, I actually love this stuff. It's perfect for handling complex state handling (like game characters, just think of the combinations in Mortal Combat et al.) It's a graceful solution for that kind of stuff. I used to go about that using multiple dimensional arrays or something.
|
|
| Showcase Tools | |
| Display Modes | |
|
|



3 comments
| 263 views




Linear Mode
I understand state machines, just not what I might use one for (in a framework as such). I suspect they might be useful in a pathfinding algorithm or something...
[edit]
Actually, this is looking very good indeed. I'm thinking defining a statemachine to define from which positions a game character is allowed to do what actions (resulting in new positions).
Also, I see you've used FlashDevelop (