PixelWars/behaviors/hello.cpp

11 lines
305 B
C++

#include <cstdlib>
#include "behavior.h"
// g++ -shared hello.cpp -o hello.dll -I../src
extern "C" void think(Action *action, char *memory, const Info *info)
{
action->type = Action::MOVE; // the Dude will move
action->dir = Dir(std::rand() % 4 ); // the direction of the movement will be random
}