wiki:ControlSystems/SoftwareTeam/Training/VirtualTraining/HelloRoboCode

Version 5 (modified by David Albert, 5 years ago) (diff)

--

Build a Bot

The real fun of RoboCode is that it lets you build your own robot and program it in Java. Let's build a simple robot and battle it against one of the trainer bots: Robot Editor

  1. Launch RoboCode and choose Robot->Source editor
  2. If asked, answer Yes, then OK to use the Java language compiler you installed

You're now in the Robot Editor where you can create the program for your robot.

  1. Choose File->New->Junior Robot
  2. Give your robot a name like RoboJojo - note that the name must start with an upper-case letter.
  3. Create a package name for your robot. Packages are like teams of robots; you can create many robots and add all of them to your package. Give it a unique name that's easy to identify so when you are doing battles with teammates and in competitions, it's easy to identify your robots. For example: daa2537 (your initials and team)




The editor starts with a pre-created super-simple robot that you can modify and extend. Let's use it as-is to see what it does. RoboCode Compilation

  1. Save the robot: File->Save accept the default filename (e.g. RoboJojo.java)
  2. Compile the robot Compiler->Compile and press OK when the compilation finishes. Compiling a program converts the text of your robot program into a program the computer can understand and battle in the arena.
  3. Close the Robot Editor

Finally, create a new battle and test your robot against one of the supplied trainers. When you choose robots, you'll see a new package under Available Robots (e.g. daa2537) and the robot you created (e.g. RoboMojo?) in the list of robots. Add it to the battle and then choose add of the trainer robots from the sample package. Finally, start your battle!


RoboJojo Battle 1

Attachments (3)

Download all attachments as: .zip