⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tracker.c

📁 偶然收集到的一个C语言源码
💻 C
字号:
#include <airobot/c/SimpleRobot.h>

/**
 * 每个单位时间都会触发
 */
void onTick(struct TickAction* action)
{
	struct Bot* opponent = getFirstOpponent();
	if(opponent==NULL) return;
	moveTo(opponent->x, opponent->y);
	if(opponent->getLocation()->distance(getLocation())<150)
		{
			fire(opponent->getLocation(), 2);
		}
}

/**
 * 机器人程序入口
 */
int main(int argC, char* argV[])
{
	tickHook = onTick;
	hitRobotHook = onHitRobot;	
	return startup(argC, argV);
}				

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -