3 #include <BLIB/Util/Random.hpp>
30 bl::tmap::Direction ndir =
31 static_cast<bl::tmap::Direction
>(bl::util::Random::get<int>(0, 3));
32 while (ndir == position.direction) {
33 ndir =
static_cast<bl::tmap::Direction
>(bl::util::Random::get<int>(0, 3));
Core classes and functionality for both the editor and game.
EntityControl fromDirection(bl::tmap::Direction direction)
Helper method to convert a move direction to a control.
Adding this component to an entity allows it to be controlled.
bool processControl(input::EntityControl command, bool sprint=false, bool overrideLock=false)
Processes the given command and manipulates the entity accordingly.
SpinBehavior(file::Behavior::Spinning::Direction dir)
Construct a new Spin Behavior component.
void update(bl::tmap::Position &position, Controllable &controller, float dt)
Updates the behavior.
Direction
The direction to spin.
@ Random
The character spins randomly.
@ Counterclockwise
The character spins counterclockwise.
@ Clockwise
The character spins clockwise.
static float CharacterSpinPeriod()