package wind;
import robocode.*;
import java.awt.Color;
/**
* SnippetBot - a robot by Alisdair Owens
* This bot includes all sorts of useful snippets. It is not
* designed to be a good fighter (although it does well 1v1),
* just to show how certain things are done
* Bits of code lifted from Nicator and Chrisbot
* Conventions in this bot include: Use of radians throughout
* Storing absolute positions of enemy bots rather than relative ones
* Very little code in events
* These are all good programming practices for robocode
* There may also be methods that arent used; these might just be useful for you.
*/
public class SnippetBot extends AdvancedRobot
{
/**
* run: SnippetBot's default behavior
*/
Enemy target; //our current enemy 代表对手,包括
了对手的所有有用参数
final double PI = Math.PI; //just a constant
int direction = 1; //direction we are heading...1 = forward,
-1 = backwards
评论0