Wiki

Case Status
Log In

Wiki

 
Home ยป Samples»M2H Catch Egg»M2H Catch Eggs Game, gui Fsm
Index
Navigation
Community Wiki

M2H Catch Eggs Game, gui Fsm

we show the number of eggs caught

A very simple Fsm again:

It shows the score, and when it receives a "EGG CAUGHT" event,  increase the score by one and comes back to the "gui" state to show the score again. The "EGG CAUGHT" event is fired by the egg collider Fsm

One important thing here is to understand that the computation and process done when receiving the "EGG CAUGHT" event doesn't flicker the score, because we are moving away from the "gui" state doesn't mean necessarily that the gui shown in that state will flicker. This is true if the state and flow of states transit directly and not is not delayed or waiting for something asynchronous.

Another possible would be to have two fsm, one that never change state showing the score, and another receiving the "EGG CAUGHT" event and setting the score on that first Fsm. but this is an extra decoupling that is not neede here for this simple case.

 

Tags:

Last modified on 5/11/2012 3:06 AM by User.

  • RSS Feed