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. on
ScannedRobot() 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 set
AdjustGunForRobotTurn().
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
- I disagree. Speed cannot be negative, can it? I figured the fact that velocity was signed is what made its name make sense. --Simonton
- Well whatever about the naming of it, I think it's a good idea to have it accessible to JuniorRobots?. --Daniel
- I buy that! :) By the way, welcome to the wiki! Make a home for yourself. In fact, here, I'll help you get started :). -- Simonton
- Thank you Daniel! Of course I will add scannedVelocity to the JuniorRobot as it is obviously missing! . Simonton is right regarding speed versus velocity. Velocity is the robots speed and direction of motion. Thus, it can be negative, which means that the robot moves backwards. Speed is the absolute velocity, i.e. the distance travelled per unit time. ;-) --Fnl
- Yay, I've contributed something useful! Thanks for adding that. JuniorRobot looks great! --Daniel
- Check out [Robocode 1.4 Beta 2] where the scannedVelocity has been added. --Fnl
- Yeah, we've totally forgot about robot's velocity. I'm just figured out that there're no 'velocity' field for self-speed check. Should we have it? -- Nutch
- Yes, I think so. :-) --Fnl
scannedHeading? :-) --Daniel
- Yes, this is also missing. It does not make much sense to know the velocity (moving forward or back) without knowing it's heading! I will add this too. ;-) --Fnl
- Done! --Fnl
- w00t! Now a JuniorRobot can do predictive linear targeting! --Daniel
- Heh.. I hope that should be okay? ;-) --Fnl