Changes between Version 2 and Version 3 of ControlSystems/SoftwareTeam/Training/VirtualTraining/JuniorRobot
- Timestamp:
- Aug 31, 2020, 11:44:44 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ControlSystems/SoftwareTeam/Training/VirtualTraining/JuniorRobot
v2 v3 78 78 79 79 === Observers === 80 The Junior Robot class defines several observer methods that are invoked automatically when something happens in the battle. For example, as the robot scans its surroundings, if it sees another robot in front of it, the onScannedRobot() method is invoked. In this case, the robot will fire when it sees another robot in front of it.80 The Junior Robot class defines several observer methods that are invoked automatically when something happens in the battle. (you'll sometimes hear observer methods referred to as "listeners" or "callbacks"). For example, as the robot scans its surroundings, if it sees another robot in front of it, the onScannedRobot() method is invoked. In this case, the robot will fire when it sees another robot in front of it. 81 81 {{{ 82 82 } … … 110 110 } 111 111 }}} 112 113 == Exercises == 114 1. Run RoboJojo again and observe how the behaviors of the robot relate to the methods. 115 1. Change the methods in the robot's main loop to make its behavior more interesting, try making the robot travel in a square and fire its gun at each corner.