#include <airobot/c/SimpleRobot.h>
/**
* 每个单位时间都会触发
*/
void onTick(struct TickAction* action)
{
double fireHeading;
struct Bot *opponent = getFirstOpponent();
if (opponent == NULL)
return;
fireHeading = heading(getX(), getY(), opponent->x, opponent->y);
fire(fireHeading, 3);
}
/**
* 机器人程序入口
*/
int main(int argC, char* argV[])
{
tickHook = onTick;
return startup(argC, argV);
}