German Larrain  committed 1e90c9c

Vehicle2 demo: changes to use the new feature allowing to register functions to be called in every step of a frame, instead of once.
-Torque constant is much smaller.
-Constructor's calls to self.key_press_functions.add were modified with a new argument (repeat) with a value of True.

  • Participants
  • Parent commits e465c70
  • Branches dev

Comments (0)

Files changed (1)

File bin/

 class Vehicle2(Program):
-	TORQUE = 200
+	TORQUE = 30
 	OFFSET = (3,1,3)
 	def __init__(self):
 		""" Constructor, calls first the superclass constructor. """
-		self.key_press_functions.add('up', self.go_forwards)
-		self.key_press_functions.add('down', self.go_backwards)
-		self.key_press_functions.add('left', self.turn_left)
-		self.key_press_functions.add('right', self.turn_right)
+		self.key_press_functions.add('up', self.go_forwards, True)
+		self.key_press_functions.add('down', self.go_backwards, True)
+		self.key_press_functions.add('left', self.turn_left, True)
+		self.key_press_functions.add('right', self.turn_right, True)
 	def create_sim_objects(self):