User Tools

Site Tools


pf:createbond

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
pf:createbond [2015/03/01 22:13] – Removed "discussion tag and raw code section Karsten75pf:createbond [2015/03/04 18:32] (current) – removed pawel345
Line 1: Line 1:
-<- [[pf:alphabetic_list_of_commands| Alpha List of Commands]] <-[[class link]] <-[[pf:prpl_information|PRPL home]] <-[[pf:start| Game 4 home]]   
-=====  CreateBond   ===== 
  
-^Arguments^Result^Notation^ 
-|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 [[pf:setbondmovementparams | 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 [[pf:setbondmovementparams | 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. 
-<code> 
-CreateParticle(CurrentPixelCoords 20 add 0 20 1 1) ->p1 
-CreateParticle(CurrentPixelCoords 20 sub 0 20 1 1) ->p2 
-CreateBond(<-p1 <-p2 1 40) ->b 
-</code> 
-Instead have them move in opposite directions; the bond forces them to rotate. 
-<code> 
-CreateParticle(CurrentPixelCoords 20 add 0 20 1 1) ->p1 
-CreateParticle(CurrentPixelCoords 20 sub 180 20 1 1) ->p2 
-CreateBond(<-p1 <-p2 1 40) ->b 
-</code> 
pf/createbond.1425248015.txt.gz · Last modified: 2025/02/14 14:56 (external edit)