Sheep behaviour

Sheep states
Idle moving (affected by flocking) This is the default and starting state of the sheep. This state can be overwritten by any of the other states

Swiped (not affected by flocking)
The Swiped state overwrites the Idle moving and Hold state of the sheep. A Sheep enters the Swiped state when the users input is recognized as a swipe. A sheep affected by a swipe will remain in this state for X time, and then fall back into the Idle moving state. In the Swiped state, the sheep will get a speed boost as long as the sheep remains in the Swiped state. In this state, the direction the sheep is moving is dictated by the direction of the player swipes. At the end of the Swiped state the sheep will gradually transition to Idle moving state.

Hold (not affected by flocking)
The Hold state overwrites both the Idle moving and the Swiped state. The Hold state is triggered once the sheep walks into a wall object. When a sheep is in the Hold state, it will simply sand still until this state is overwritten by other factors (like a Swipe or the hold-animation being done).

Eating
Eating is a special state of Hold. While Eating the sheep will be on Hold until it is done eating. When the sheep is done eating it will return to the Idle moving state. Eating can be overwritten by other state.

Scared (not affected by flocking)
The scared state is simply a different animation. A sheep can get scared and go into a frenzy. The Scared state can overwrite any other state but the Trapped state. When a sheep is scared it will move with X speed for Y time in Z direction. The X and Y variables will properly be predefined (though the designers need to tweak it nonetheless), and the Z variable will be relative to what object scared the sheep. If a sheep was scared by an object that is behind the sheep (at 270 degrees relative to the sheep), the sheep will run in any random direction between 0 and 180 degrees relative to the sheep. We might want to narrow the direction in which the sheep can run down.

The Scared state is triggered if a sheep collides with a Scary-trigger-box.

It would be interesting if one scared sheep can scare another, or a whole flock can get scared at once, but not for now.

Trapped (not affected by flocking)
The Trapped state is triggered if a sheep collides with a Trap object. The trap state overwrites all other sheep states. Once a sheep is Trapped it is locked down on its current position until captured by the Cyclops or Freed by the player by using God Powers.