![]() You should have a look at all the sample robots to see how certain things are done.Īfter you have gotten used to Robocode, you will probably want to switch your robot to an AdvancedRobot. sample.Target, and press the Start Battle button to let the games begin! Add your robot to the battle together with at least one other robot as e.g. (If you cannot see your robot, you might have to refresh the list of robots by selecting Options -> Clean robot cache). Start a new battle by selecting New in the Battle menu. If your robot compiles without any errors, you can start a new battle with your robot. Now, compile it by selecting Compile in the Compiler menu. Let's just fire!įirst, save your robot by selecting the Save in the File menu. ![]() However, since this is a simple robot, we're not going to look at any of that stuff. It sends along an event that can tell us lots of information about the robot ‒ its name, how much life it has, where it is, where it's heading, how fast it's going, etc. The game calls your onScannedRobot() method whenever ‒ during one of the actions ‒ you see another robot. 1 package pkg 2 3 import robocode.* 4 5 public class YourRobotNameHere extends Robot
0 Comments
Leave a Reply. |