User Tools

Site Tools


prpl:docs:createbond

Differences

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

Link to this comparison view

Next revision
Previous revision
prpl:docs:createbond [2015/03/04 15:52] – external edit 127.0.0.1prpl:docs:createbond [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
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> 
prpl/docs/createbond.1425484328.txt.gz · Last modified: 2025/02/14 14:56 (external edit)