Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

Event driven game flow

This topic is 1858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Last time people told me about data driven style of game programming.

Now I want to finish this part first, then consider data driven later.

I learn that a game should be data+event driven,

With the event driven part,

a class would have something like

OnLeftClick

 

OnUpdate

 

OnRender

 

On... whatever,

What are the principles behind all these?

 

cause I don't want to do this.

 

do  {
   assignWork();
   findPath();
   
   work();
   
} while (!finished)

Thanks

Jack

Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement

I know now, they are called state machines. But state machines don't merely change states, they have to do something.

When do they start to do real work? Like when I change the state of a goblin to "live", when do I make it attack the player (update animations and render)?

Thanks

Jack

Share this post


Link to post
Share on other sites

Should each object have its own state machine?

 

class Horse

{

    FSMclass m_StateMachine;

};

 

class Dog

{

   FSMclass m_StateMachine;

};

 

Of course, I can have an abstract class to contain it.

 

Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!