What it does
CreateRopeJoint brings a 2DPhysics object into being: it is how the rest of the program comes to have one. It takes jointID (an integer), spriteID1 (an integer), spriteID2 (an integer), x (a float), y (a float), x2 (a float), y2 (a float), maxLength (a float) and colConnected (an integer), 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
CreateRopeJoint(jointID integer, spriteID1 integer, spriteID2 integer, x float, y float, x2 float, y2 float, maxLength float, colConnected integer)2
CreateRopeJoint(spriteID1 integer, spriteID2 integer, x float, y float, x2 float, y2 float, maxLength float, colConnected integer) → integerParameters
| Name | Type | In forms |
|---|---|---|
| jointID | integer | 1 |
| spriteID1 | integer | all |
| spriteID2 | integer | all |
| x | float | all |
| y | float | all |
| x2 | float | all |
| y2 | float | all |
| maxLength | float | all |
| colConnected | integer | all |
What each form returns
| 1 | CreateRopeJoint(1, 1, 1, 100.0, 120.0, 1.0, 1.0, 1.0, 1) | nothing |
| 2 | ropeJoint = CreateRopeJoint(1, 1, 100.0, 120.0, 1.0, 1.0, 1.0, 1) | integer |
Example · generated
Form 1, you choose the id yourself
CreateRopeJoint(1, 1, 1, 100.0, 120.0, 1.0, 1.0, 1.0, 1)DO Sync()LOOPForm 2, the command hands back the id
ropeJoint = CreateRopeJoint(1, 1, 100.0, 120.0, 1.0, 1.0, 1.0, 1)DO Sync()LOOPCreateRopeJoint 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.