Everything Robocode


Robot Overview

  Every robot(except for a droid, which we won't get into now) has three parts: Body, Gun, and Radar. These are essential to the robot. The radar locks on to the enemy, scans him, and gives you useful information about him. Among this information if his health, heading, and velocity. The gun is used to shoot at the enemy. Everytime it fires, heat is generated. The robot can not fire again until the heat has gone down to zero. Movement is used to dodge enemy bullets.

  Here are some functions to call which will return statistics on your robot.

  getHeading() - which direction your robot is facing. It returning 0 degrees means you are facing directly north, 90 directly east, 180 directly south, and 170 directly west.

  getEnergy() - will return how much life your robot has. This can be essential to decide if you want to attack or play it safe.

  getGunHeading() - like getHeading(), but which way your gun is facing.

  getRadarHeading() - like getHeading(), but which way your radar is facing.

  getVelocity() - your robot's current velocity - between -8 and +8

  The goal of robocoding is this: hit the enemy more times than he hits you. To achieve this goal, you will have to use all three parts of your robot to their fullest.

  If you have been able to understand what the basic robot does, have been able to edit him, and have played around with the functions described above, please proceed on our other pages on radar, movement, and gun control hints to get you started.


You are viewing the text version of this site.

To view the full version please install the Adobe Flash Player and ensure your web browser has JavaScript enabled.

Need help? check the requirements page.

Get Flash Player