[][src]Module tokyo::behavior

Structs

Chase

A Behavior to keep moving towards the specified target until it reaches within the distance.

Dodge

A Behavior to keep dodging nearby bullets as much as possible. Note that the current implementation has a lot of room for improvements.

Fire

A Behavior to fire the specified number of times.j

FireAt

A Behavior to rotate to the target and fire the specified number of times.

Forward

A Behavior to keep yielding GameCommand::Throttle commands until it travels the distance.

Noop

A Behavior to do nothing.

Rotate

A Behavior to rotate to the specified angle. It yield None if the current angle is within the error margin.

Sequence

Sequence represents a series of Behaviors. The first Behavior::next_command() is repeatedly called until it yields None, and then it moves to the second Behavior, and so forth.

Enums

Target

Target enum is used to specify a Player based on some predefined conditions. Some Behaviors like FireAt works with Target to dynamically compute the target Player.

Traits

Behavior

Behavior trait abstracts an action or a series of actions that a Player can take. It may be useful if you want to model a complex behavior, that spans multiple ticks, or whose interpretation changes dynamically. You can use Sequence::with_slice() to combine multiple behaviors.