Difference between revisions of "Robocode/Eclipse/Create a Robot"

From Robowiki
Jump to navigation Jump to search
m (Not a stub anymore)
m (Image)
Line 6: Line 6:
 
First, right-click on the '''MyRobots''' project, and select New -> Class:
 
First, right-click on the '''MyRobots''' project, and select New -> Class:
  
http://robocode.sourceforge.net/help/ide/newclass.png
+
[[Image:Eclipse-NewClass.png|Shows how to select a new class by right-clicking on the MyRobots project]]
 +
 
  
 
Next, fill in the package name (Robocode suggests your initials), a Robot Name (here I have '''FnlBot'''), and change the '''Superclass''' field to '''robocode.Robot''':
 
Next, fill in the package name (Robocode suggests your initials), a Robot Name (here I have '''FnlBot'''), and change the '''Superclass''' field to '''robocode.Robot''':

Revision as of 13:52, 1 December 2007

This page describes how to create a robot in Eclipse, and assume that you already now how to create a project in Eclipse.

Creating a Robot in Eclipse

Ok, so we have a project now, and it's time to create a robot (or many robots!) in it.

First, right-click on the MyRobots project, and select New -> Class:

Shows how to select a new class by right-clicking on the MyRobots project


Next, fill in the package name (Robocode suggests your initials), a Robot Name (here I have FnlBot), and change the Superclass field to robocode.Robot:

http://robocode.sourceforge.net/help/ide/newclassdialog.png

Click Finish, and you'll see your robot class, like this:

http://robocode.sourceforge.net/help/ide/edit1.png

You can now edit your robot however you like.

http://robocode.sourceforge.net/help/ide/edit2.png

You can save your robot as often as you like by hitting CTRL-S, or selecting File->Save. There's no need to explicit select Compile (as in the Robot Editor for Robocode) anymore, since Eclipse automatically takes care of this task for you, when you make changes to your files.

Have fun playing around with Eclipse. Since there's no better way to learn than by playing around, I'll leave you to it!

The only thing left is to make sure that Robocode sees your robot.

See Also