On Collision With Do/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 9: | Line 9: | ||
==Syntax== | ==Syntax== | ||
[[File:On Collision With Do Nums.png|right|alt=On Collision With Do|thumb]] | |||
<!-- <code>on collision with [Dropdown: Type of Agent] do [code]</code> --> | <!-- <code>on collision with [Dropdown: Type of Agent] do [code]</code> --> | ||
Inputs: | Inputs: |
Revision as of 19:15, 10 August 2023
Tells the "owner" of the block what to do when it bumps into an agent of the selected breed. The “owner” is an agent of the breed whose page is where this collision block is put.
on collision with [▼] do
is a code block from the Detection drawer.
Usage
on collision with [▼] do
begins the execution of a stack of code when a collision is detected with a specific type of agent denoted in the drop down selector. The agent collided with is known as the "collidee". This agent can be referenced using the collidee
block.
Syntax
Inputs:
- a breed from the dropdown menu
- relevant code
Nuances
on collision with [▼] do
cannot be used as a conditional such as if
. on collision with [▼] do
must begin a stack of code.