Java Game Development - robot virtual world- Finite State Machine
hey, i am looking some advise on buidling a Finite State Machine using java. I im about to start a project where i must create a "virtual robot world" which consists of a number of robot agents (simple filled rectangles). Each of these agent will have a number of states such as stopped, creeping, fleeing etc etc and there states will be triggered by actions of events by other agents. For exmaple for my first stage i want the following
2 agents, the prey and the predator. The predator moves towards the prey
in short spurts. Between movements the predator simply pauses. If the prey
does not move the predator will ultimately end up attacking the prey.
However, if at any stage the prey moves towards the predator the predator
will pause. If the prey does not move closer after a period, then the
predator will continue to move towards the prey. However, if the prey
moves towards the predator again the predator will pause again. Ultimately,
if the predator's number of pauses increases to a certain value, then if the prey moves towards the predator the predator will flee.
I would appreciate any advice on setting up a simple FSM in java that would satisfy the above states and actions
Cheers!

