Robo Home | Changes | Preferences | AllPages

The JuniorRobot class was introduced with Robocode 1.4. This new robot type has been designed by the [Cubic Creative team].

This robot class is simpler to use than the well-known Robot and AdvancedRobot classes and has a simplified model, in purpose of teaching programming skills to inexperienced in programming students.

Experienced Robocode programmers should notice that the JuniorClass? is not extended from any existing robot class, i.e. the Robot or AdvancedRobot class. It is a new robot class branch. Practically all method calls are "blocking" calls similar to those of the Robot class. However, the event handlers are simpler, and event info for e.g. onScannedRobot() are automatically stored in field variables. And fire is delayed until the gun has finished its turn and the gun is able to fire (gun heat = 0). They don't take damage when they hit walls.

Key features

1. run(): The run() method is automatically re-run when it has reached the last statement, meaning that there is no need of a 'while (true)'.
2. radar: The radar cannot move independently but is fixed with the gun rotation.
3. gun: The gun is always fixed on a body. Its angle movement will always relative to body rotation. No more setAdjustGunForRobotTurn().
4. 'int' vs 'double': All values will be 'int' instead of 'double', except for 'fire()' only, will still have 'fire (double power)' overload.
5. field values: Values like the current position of the robot, and event info is automatically stored in specific field values.
6. events: Due to (5), events handler objects (like ScannedRobotEvent and HitRobotEvent? classes) does not exist with the JuniorRobot.
7. fire: When fire() is called, a bullet will first/automatically be fired when the gun has stopped its current turning and when the gun heat is 0.

How about velocity, scannedVelocity, etc? Actually, I submit that the name be changed to "speed" while there's the opportunity since that's what it really is. Though this might be confusing when making a transition to "Robot" or "AdvancedRobot", it may be worth the relearning of the term at that stage in order to make the introduction via JuniorRobot that bit easier. --Daniel

scannedHeading? :-) --Daniel

Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited August 9, 2007 19:30 EST by Fnl (diff)