What it does
CreateGearJoint brings a 2DPhysics object into being: it is how the rest of the program comes to have one. It takes jointID (an integer), jointID1 (an integer), jointID2 (an integer) and ratio (a float), and returns nothing. That is the first of 2 forms. jointID is the id you are giving a Joint object: every later call names it by that number.
Syntax
1
CreateGearJoint(jointID integer, jointID1 integer, jointID2 integer, ratio float)2
CreateGearJoint(jointID1 integer, jointID2 integer, ratio float) → integerParameters
| Name | Type | In forms |
|---|---|---|
| jointID | integer | 1 |
| jointID1 | integer | all |
| jointID2 | integer | all |
| ratio | float | all |
What each form returns
| 1 | CreateGearJoint(1, 1, 1, 1.0) | nothing |
| 2 | gearJoint = CreateGearJoint(1, 1, 1.0) | integer |
Example · generated
Form 1, you choose the id yourself
CreateGearJoint(1, 1, 1, 1.0)DO Sync()LOOPForm 2, the command hands back the id
gearJoint = CreateGearJoint(1, 1, 1.0)DO Sync()LOOPCreateGearJoint is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.