On Collision With Do: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


<!--T:1-->
<section begin="image"/>[[File:On Collision With Do Block.png|alt=The on collision with do block|thumb]]<section end="image"/>
<section begin="image"/>[[File:On Collision With Do Block.png|alt=The on collision with do block|thumb]]<section end="image"/>
<section begin="name" />'''{{Block|on collision with [▼] do}}'''<section end="name" /> is a code block from the [[Detection]] drawer.
<section begin="name" />'''{{Block|on collision with [▼] do}}'''<section end="name" /> is a code block from the [[Detection]] drawer.


<!--T:2-->
==Usage==
==Usage==
<p id="tooltip">{{Block|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 {{Block|l|collidee}} block.</p>
<p id="tooltip">{{Block|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 {{Block|l|collidee}} block.</p>


<!--T:3-->
===Syntax===
===Syntax===
<code>on collision with [Dropdown: Type of Agent] do [code]</code>
<code>on collision with [Dropdown: Type of Agent] do [code]</code>


<!--T:4-->
==Nuances==
==Nuances==
{{Block|on collision with [▼] do}} cannot be used as a [[conditional]] such as {{Block|l|if}}. {{Block|on collision with [▼] do}} must begin a [[stack]] of code.
{{Block|on collision with [▼] do}} cannot be used as a [[conditional]] such as {{Block|l|if}}. {{Block|on collision with [▼] do}} must begin a [[stack]] of code.


<!--T:5-->
==Related Blocks==
==Related Blocks==
*{{Block|l|collidee}}
*{{Block|l|collidee}}


<!--T:6-->
[[Category:Detection]]
[[Category:Detection]]
[[Category:Code Block]]
[[Category:Code Block]]
</translate>
</translate>

Revision as of 17:04, 22 June 2023

Other languages:
The on collision with do block

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

on collision with [Dropdown: Type of Agent] do [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.

Related Blocks