(AI-TANK)朝着机器人原点开火(最简单的第一个开火)

来源:互联网 发布:java执行输入参数命令 编辑:程序博客网 时间:2024/04/29 04:29
#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);}

原创粉丝点击