Block Glossary
Agents
Block | Name | Usage | Image |
---|---|---|---|
Create Each Do | create [_] [▼](s) each do
|
|
|
Delete | delete
|
||
Delete Everyone | delete everyone
|
|
|
Delete Agent | delete agent [_]
|
|
|
Scatter | scatter
|
|
|
Scatter Everyone | scatter everyone
|
Note: if this block is used in an breed tab where more than one agent of that breed exists, each individual agent of this breed will scatter everyone once. For example, if there are five agents of the breed, everyone will be scattered 5 times as each individual agent runs the code. |
|
Take Camera | take camera
|
can be useful for implementing interactive games from the first-person perspective. |
|
Me | me
|
|
|
My Parent | my parent
|
|
|
Create | create [_] [▼](s)
|
|
Detection
Block | Name | Usage | Image |
---|---|---|---|
Collidee | collidee
|
|
|
Count Within Steps | count [▼] within [_] steps
|
|
|
Count Within Steps With = | count [▼] within [_] steps with [▼] = [_]
|
|
|
Nearest Within Steps | nearest [▼] within [_] steps
|
|
|
Nearest Within Steps With = | nearest [▼] within [_] steps with [▼] = [_]
|
|
|
On Collision With Do | on collision with [▼] do
|
|
Environment
Block | Name | Usage | Image |
---|---|---|---|
Clear Terrain | clear terrain
|
|
|
Set World To | set world [▼] to [_]
|
|
|
Stamp | stamp [_]
|
|
|
Stamp Grid | stamp grid [_]
|
|
|
Pen | pen [▼]
|
|
|
Terrain Color | terrain color
|
|
|
Clock | clock
|
|
|
Set Clock To | set clock to [_]
|
|
|
World Trait | world trait: [▼]
|
|
|
The World | The World
|
|
|
Reset Terrain Heights | |||
Terrain Height | |||
Get Patch | |||
Dig | |||
Build | |||
Set Patch To | |||
Interpolate | |||
World Glow Amount | |||
Yank Wide | |||
Stomp Wide | |||
Yank Grid | |||
Stomp Grid | |||
Set Directional Light Intensity | |||
Set Directional Light Color | |||
Set Directional Light | |||
Set World Glow To |
Interface
Block | Name | Usage | Image |
---|---|---|---|
When Pushed | when [▼] pushed
|
Note: It is useful to use the ‘when pushed’ with a push button widget when you want to execute a code segment once. |
|
While Toggled | while [▼] toggled
|
Note: It is useful to use the ‘while toggled’ block with the toggle button widget if you want the code to execute multiple times until the widget is toggled off. |
|
Hide | hide [▼]
|
|
|
Show | show [▼]
|
|
|
Set Data Box To | set [▼] data box to [_]
|
|
|
Data Box | [▼] data box
|
Note: You should use data boxes for numerical values and labels for textual values. One advantage of using a data box is that you can title it. |
|
Set Label To | set [▼] label to [_]
|
|
|
Label | [▼] label
|
|
|
Slider Value | [▼] slider value
|
|
|
Add Data To Line Graph | Add data to line graph [▼] for [▼] x-axis: [_] y-axis: [_]
|
|
|
Clear Line Graph | clear line graph [▼]
|
|
|
Engine Tick Rate | |||
Toggle To For |
Keyboard
Block | Name | Usage | Image |
---|---|---|---|
Key Held? | [▼] key held?
|
|
|
Key typed? | [▼] key typed?
|
|
Lists
Block | Name | Usage | Image |
---|---|---|---|
Insert Into List At Index | |||
Splice List Into List At Index | |||
Remove Item Number From | |||
Item Number In | |||
Index Of In | |||
Contains | |||
Length Of | |||
List |
Logic
Block | Name | Usage | Image |
---|---|---|---|
If | if [_]
|
|
|
If Else | |||
While | |||
With % Chance | |||
Repeat Times | |||
Yield | |||
Equals | |||
Not |
Negates the input. So, if the expression evaluates to true, then returns false. If the expression evaluates to false, then returns true. |
||
Not Equals |
Determines whether the two inputs are unequal and returns true or false. |
||
Less Than |
Determines if the first input is less than the second input and returns true or false. |
||
Greater Than |
Determines if the first input is greater than the second input and returns true or false |
||
Less Than Or Equal To |
Determines if the first input is less than or equal to the second input and returns true or false. |
||
Greater Than Or Equal To |
Determines if the first input is greater than or equal to the second input and returns true or false. |
||
And |
Determines if both the first and second inputs are true. If both are true, then returns true; if one or both of the statements are false, this block returns as false. |
||
Or |
Determines if either the first or second input are true. If at least one is true then returns true; else returns false. |
||
True |
Returns as true. |
||
False |
Returns as false. |
Math
Block | Name | Usage | Image |
---|---|---|---|
Random To | random [_] to [_]
|
|
|
Pi |
Returns the numerical value of pi (3.14159...). |
||
Random Decimal |
A random decimal between 0 and 1. |
||
Sum |
Returns the sum of two inputs. |
||
Difference |
Returns the difference of two inputs. |
||
Product |
Returns the product of two inputs. |
||
Quotient |
Returns the quotient of two inputs. |
||
Remainder Of |
Returns the remainder of the first input divided by the second input. |
||
Sin Cos Tan |
Compute the mathematical operations of sine, cosine, or tangent and takes as input a value in degrees. |
||
Arcsin Arccos Arctan |
Computes the mathematical operations of arcsine, arccosine, or arctangent and returns a value in degrees. |
||
Sqrt |
Returns the square root of the input. |
||
Log |
Returns the log (base 10) of the input. |
||
Ln |
Returns the natural log of the input. |
||
Power |
Returns the value of the first input raised to the power of the second input. |
||
Larger Of And |
Returns the larger or smaller value of the two inputs. |
||
Round To Decimal Place(s) |
Returns the rounded value of the first input with a specified number of decimal points. |
||
Abs |
Returns the absolute value of the input. |
Movement
Block | Name | Usage | Image |
---|---|---|---|
Forward | forward [_]
|
|
|
Backwards | backwards [_]
|
|
|
Left By Degs | left by [_] degs
|
|
|
Right By Degs |
|
||
Up |
Will move any agent upwards in the “z” direction by the number of steps specified. |
||
Down |
Will move any agent downwards in the “z” direction by the number of steps specified. |
||
Face Towards |
Turns to face the agent specified. |
||
Teleport To |
Instantly moves to the specified coordinate. |
Procedures
Block | Name | Usage | Image |
---|---|---|---|
Procedure |
Defines a grouping of commands to do a particular function. Select “name” and type over it to rename the procedure. |
||
Call |
Agent calls a defined procedure to follow from the drop down menu. |
||
Parameter |
Returns the value of a selected parameter that has been added in the procedure definition. |
||
Return-Early |
Used in a procedure definition to end a procedure early with the option of returning a value. |
||
Call (returns) |
Calls a procedure that returns a value. |
||
Block Glossary Category |
Sound
Block | Name | Usage | Image |
---|---|---|---|
Play Sound |
Plays the specified sound. |
||
Sound |
Returns the selected sound. You can upload or record your own sounds, or select one from a library of pre-loaded sounds. |
Traits
Block | Name | Usage | Image |
---|---|---|---|
My |
Returns the value of an agent's trait. |
||
Set My To |
Sets the selected trait of an agent to the value of the input. |
||
Of |
Returns the value of a trait belonging to another agent (such as collidee or my parent). |
||
Set Of To | |||
Color |
Returns a particular color or a color at random chosen from the drop down menu. |
||
Color RGB |
This block will create a color with an amount of red, green, and blue in it as specified by the input values. |
||
Built-In Shape |
Returns a particular built-in shape chosen from the drop down menu. |
||
Uploaded Shape |
Clicking on the dropdown menu will open a page in which you can select an uploaded shape you have used previously or choose to upload a new one. |
||
Glow With Intensity | |||
Stop Glowing |
Variables
Block | Name | Usage | Image |
---|---|---|---|
Value Of |
Returns the value of a selected variable. |
||
Set to |
Sets the value of a previously existing variable selected from the dropdown menu to the value of the input. |
||
Var is |
Creates a variable (a place to store data) in the agent's context with a specified name. You can rename the variable by selecting the “name” text and typing over it. You can also specify what type of variable using the drop down menu. The variable only exists in the stack of code where it is created. |
Debugger
Block | Name | Usage | Image |
---|---|---|---|
Trait | |||
Assert | |||
Breakpoint | |||
Assert Type of is | |||
Type of is | |||
Breed has trait | |||
Print to JS (value) | |||
Print to JS (condition) |