On Collision With Do: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(add tooltip text)
Line 4: Line 4:
<!--T:1-->
<!--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" /><p id="tooltip">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.</p>
 
'''{{Block|on collision with [▼] do}}'''<section end="name" /> is a code block from the [[Detection]] drawer.


<!--T:2-->
<!--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>
{{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.


<!--T:3-->
<!--T:3-->

Revision as of 14:37, 8 August 2023

Other languages:
The on collision with do block

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

On Collision With Do

Inputs:

  1. a breed from the dropdown menu
  2. 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.

Related Blocks