4 Controller DemoController.
6 CeldasControl : DemoController {
9 leftWheel, rightWheel (object).
16 new CeldasObstacle init at-location (20 * sin(n * 6.28 / 10), 1, 20 * cos(n * 6.28 / 10)).
18 vehicle = new CeldasVehicle.
19 self watch item vehicle.
21 vehicle move to (10, 2, 5).
23 leftWheel = (vehicle add-wheel at (-2, 0, -1.5)).
24 rightWheel = (vehicle add-wheel at (-2, 0, 1.5)).
25 vehicle add-wheel at (1, 0, 0).
27 leftWheel set-velocity to 15.0.
28 rightWheel set-velocity to 15.0.
30 sensor = (vehicle add-sensor at (2.0, .4, 0)).
35 value = sensor get-sensor-value.
38 leftWheel set-velocity to ((leftWheel get-velocity) + 15).
39 rightWheel set-velocity to ((rightWheel get-velocity) + 15).
40 } else if value > 10: {
41 leftWheel set-velocity to ((leftWheel get-velocity) - 15).
42 rightWheel set-velocity to ((rightWheel get-velocity) - 15).