little help

Jump to navigation Jump to search
Revision as of 13 June 2012 at 16:35.
The highlighted comment was created in this revision.

little help

Hi mate. You can change the color with:

  public void run() {
      // all the same color
       setAllColors(Color.RED);

      // or different for body , gun , radar
      setRadarColor(Color.GREEN);
      setGunColor(Color.BLUE);
      setBodyColor(Color.BLACK);
       ...
   }

You can make a bookmark to the robocode api Robocode API and there you find all the functions you can use. It looks a bit complicated if you are not familiar whit this kind of documentation but with a little help you get used to it very quickly.

For example if you look for the color. Hit the "AdvancedRobot" in the left frame "All Classes" and search just for "Color" in the right frame. Every function has a short description so just poke around a little.

And don't be shy just ask whatever you wan't to know.

take care

    Wompi12:17, 9 June 2012

    The API is your best friend. I also suggest you bookmark the Java API. The API documentation is a very useful set of documents.

    For your purposes, java.lang.Math which has math methods, java.awt.geom which has geometry, and java.util which holds most generic data structures (maps, lists, sets, etc) are the packages you will likely use the most.


    Within the robocode API, AdvancedRobot is a big bit of useful reference.

      Chase-san17:44, 9 June 2012
       

      Whenever I try to change the colour it comes up with this error message

      Compiling... BOSSSSS.java:15: cannot find symbol symbol : variable Colour location: class b.BOSSSSS

            setallcolours(Colour.RED);
                          ^
      

      1 error Compile Failed (1)

      Im a complete newby so I don't know what to do. Anyone Help?

        Rigged17:35, 13 June 2012