User Tools

Site Tools


prpl:docs:createbond

This is an old revision of the document!


<- Alpha List of Commands <-class link <-PRPL home <- Game 4 home

CreateBond

ArgumentsResultNotation
Particle UIDs, visible, distance Bond UID i1 i2 b f –

Description

Creates a bond between two particles. Set “visible” to false to make the bond invisible. The bond will be initially rigid, always maintaining a fixed distance between the particles (see SetBondMovementParams for other types). If the “distance” argument differs from the current distance between the particles, they will be moved instantly, losing their current velocity.

The command returns the bond UID, which can be passed to other bond related commands like SetBondMovementParams.

How to use

Standard CRPL p1 p2 visible distance CreateBond
Warp notation CreateBond(p1 p2 visible distance)

Examples

Create two particles with a fixed distance of 40 pixels moving to the right, and capture the bond UID.

CreateParticle(CurrentPixelCoords 20 add 0 20 1 1) ->p1
CreateParticle(CurrentPixelCoords 20 sub 0 20 1 1) ->p2
CreateBond(<-p1 <-p2 1 40) ->b

Instead have them move in opposite directions; the bond forces them to rotate.

CreateParticle(CurrentPixelCoords 20 add 0 20 1 1) ->p1
CreateParticle(CurrentPixelCoords 20 sub 180 20 1 1) ->p2
CreateBond(<-p1 <-p2 1 40) ->b
prpl/docs/createbond.1425484328.txt.gz · Last modified: 2025/02/14 14:56 (external edit)