Building state machines for enemies