Delete Agent: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(updates from Blockument)
Line 21: Line 21:
<!--T:15-->
<!--T:15-->
<code>delete agent [Special: Agent Reference]</code>
<code>delete agent [Special: Agent Reference]</code>
==Example==
[[File:delete_agent_example.gif|alt=Delete Agent example gif|thumb]]
[[File:delete_agent_example.png|alt=Delete Agent example code|thumb]]
When a red block collides with a blue block, from the red block’s perspective the blue block is the collidee.  Following a collision, the delete agent block allows for the red block to delete the blue block.  This organization mirrors the physical behavior of how the predator eats the prey.


<!--T:16-->
<!--T:16-->
Line 27: Line 34:
*<code>[[Special:MyLanguage/Delete Everyone|delete everyone]]</code>
*<code>[[Special:MyLanguage/Delete Everyone|delete everyone]]</code>
</translate>
</translate>
<strong>Note:</strong> Using the me block inside delete agent will produce the same behavior as using the delete block, which makes any agent following the instructions delete itself.

Revision as of 18:10, 11 August 2023

Other languages:
The delete agent block

Deletes the specified agent (use "collidee", "nearest", or "my parent" blocks).

delete agent [_] is a code block part of the agents drawer.

Usage

delete agent [_] is used to delete a specific agent from Spaceland.

Syntax

The Create Each Do Block

Inputs in this block:

  1. block that represents an agent (e.g. me, my parent or nearest)

delete agent [Special: Agent Reference]

Example

Delete Agent example gif
Delete Agent example code

When a red block collides with a blue block, from the red block’s perspective the blue block is the collidee. Following a collision, the delete agent block allows for the red block to delete the blue block. This organization mirrors the physical behavior of how the predator eats the prey.

Related Blocks

Note: Using the me block inside delete agent will produce the same behavior as using the delete block, which makes any agent following the instructions delete itself.