On Collision With Do/en: Difference between revisions

From StarLogo Nova Wiki
(Updating to match new version of source page)
Tag: Manual revert
(Updating to match new version of source page)
Line 7: Line 7:
<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>


===Syntax===
==Syntax==
<code>on collision with [Dropdown: Type of Agent] do [code]</code>
<section begin=image/>[[File:On Collision With Do Nums.png|right|alt=On Collision With Do|thumb]]<section end=image/>
<!-- <code>on collision with [Dropdown: Type of Agent] do [code]</code> -->
Inputs:
#a breed from the dropdown menu
#relevant code


==Nuances==
==Nuances==

Revision as of 16:09, 24 July 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 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