# Option finished After the game ended ## State Machine ## State initial
If that state is active,
> | The basic behavior stand is executed.
> | These output symbols are set:
| sent-game-state | = | sent-game-state.finished
The decision tree:
Pseudo code of the decision tree:
if ( | game.own-score >= game.opponent-score | ) | // we won
{
transition-to-state(walk1);
}
else
{
transition-to-state(lost1);
}
## State lost1
If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-sad2 ;
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 14000 | ) | // after 14 seconds
{
transition-to-state(lost2);
}
else
{
transition-to-state(lost1);
}
## State lost2
If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-sad3 ;
The decision tree:
Pseudo code of the decision tree:
transition-to-state(lost2);

## State walk1

If that state is active,
> | The basic behavior go-to-point-and-avoid-obstacles is executed. Parameters:
| go-to-point-and-avoid-obstacles.x | = | 0 ;
| go-to-point-and-avoid-obstacles.y | = | 0 ;
| go-to-point-and-avoid-obstacles.max-speed | = | 150 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 3000 | ) | // after 3 seconds
{
transition-to-state(turn);
}
else
{
transition-to-state(walk1);
}

## State turn

If that state is active,
> | The basic behavior walk is executed. Parameters:
| walk.rotation-speed | = | -90 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.look-to-stars
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 4500 | ) | // after 4 seconds
{
transition-to-state(cheer1);
}
else
{
transition-to-state(turn);
}

## State cheer1

If that state is active,
> | The option do-special-action is executed. Parameters:
| do-special-action.special-action-id | = | special-action.cheer-happy6 ;
The decision tree:
Pseudo code of the decision tree:
if ( | subsequent-option-reached-target-state | ) | // finished
{
transition-to-state(walk2);
}
else
{
transition-to-state(cheer1);
}

## State walk2

If that state is active,
> | The basic behavior go-to-point-and-avoid-obstacles is executed. Parameters:
| go-to-point-and-avoid-obstacles.x | = | 0 ;
| go-to-point-and-avoid-obstacles.y | = | 0 ;
| go-to-point-and-avoid-obstacles.max-speed | = | 150 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 4000 | ) | // after 4 seconds
{
transition-to-state(cheer2);
}
else
{
transition-to-state(walk2);
}

## State cheer2

If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-wave-left ;
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 5000 | ) | // after 5 seconds
{
transition-to-state(walk3);
}
else
{
transition-to-state(cheer2);
}

## State walk3

If that state is active,
> | The basic behavior go-to-point-and-avoid-obstacles is executed. Parameters:
| go-to-point-and-avoid-obstacles.x | = | 0 ;
| go-to-point-and-avoid-obstacles.y | = | 0 ;
| go-to-point-and-avoid-obstacles.max-speed | = | 150 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 4000 | ) | // after 4 seconds
{
transition-to-state(cheer3);
}
else
{
transition-to-state(walk3);
}

## State cheer3

If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-happy2 ;
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 5000 | ) | // after 5 seconds
{
transition-to-state(walk4);
}
else
{
transition-to-state(cheer3);
}

## State walk4

If that state is active,
> | The basic behavior go-to-point-and-avoid-obstacles is executed. Parameters:
| go-to-point-and-avoid-obstacles.x | = | 0 ;
| go-to-point-and-avoid-obstacles.y | = | 0 ;
| go-to-point-and-avoid-obstacles.max-speed | = | 150 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 8000 | ) | // after 8 seconds
{
transition-to-state(cheer4);
}
else
{
transition-to-state(walk4);
}

## State cheer4

If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-nod-head ;
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 5000 | ) | // after 5 seconds
{
transition-to-state(walk5);
}
else
{
transition-to-state(cheer4);
}

## State walk5

If that state is active,
> | The basic behavior go-to-point-and-avoid-obstacles is executed. Parameters:
| go-to-point-and-avoid-obstacles.x | = | 0 ;
| go-to-point-and-avoid-obstacles.y | = | 0 ;
| go-to-point-and-avoid-obstacles.max-speed | = | 150 ;
> | These output symbols are set:
| head-control-mode | = | head-control-mode.search-for-landmarks
The decision tree:
Pseudo code of the decision tree:
if ( | time-of-state-execution > 8000 | ) | // after 8 seconds
{
transition-to-state(cheer5);
}
else
{
transition-to-state(walk5);
}

## State cheer5

If that state is active,
> | The basic behavior special-action is executed. Parameters:
| special-action-id | = | special-action.cheer-head-stand ;
The decision tree:
Pseudo code of the decision tree:
transition-to-state(cheer5);