CreatePrismaticJoint

Family: 2DPhysics · 2 forms

What it does

CreatePrismaticJoint 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), vx (a float), vy (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
CreatePrismaticJoint(jointID integer, spriteID1 integer, spriteID2 integer, x float, y float, vx float, vy float, colConnected integer)
2
CreatePrismaticJoint(spriteID1 integer, spriteID2 integer, x float, y float, vx float, vy float, colConnected integer) → integer

Parameters

NameTypeIn forms
jointIDinteger1
spriteID1integerall
spriteID2integerall
xfloatall
yfloatall
vxfloatall
vyfloatall
colConnectedintegerall

What each form returns

1CreatePrismaticJoint(1, 1, 1, 100.0, 120.0, 1.0, 1.0, 1)nothing
2prismaticJoint = CreatePrismaticJoint(1, 1, 100.0, 120.0, 1.0, 1.0, 1)integer

Example · generated

Form 1, you choose the id yourself

CreatePrismaticJoint(1, 1, 1, 100.0, 120.0, 1.0, 1.0, 1)DO  Sync()LOOP

Form 2, the command hands back the id

prismaticJoint = CreatePrismaticJoint(1, 1, 100.0, 120.0, 1.0, 1.0, 1)DO  Sync()LOOP

CreatePrismaticJoint 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.

66 commands in 2DPhysics