Al colisionar con hacer

From StarLogo Nova Wiki
Revision as of 15:35, 16 August 2023 by FuzzyBot (talk | contribs) (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
Al colisionar con hacer

al colisionar con [▼] hacer es un bloque de código del Detección cajón.

on collision with [▼] do is a code block from the Detection drawer.

Uso

en colisión con [▼] do comienza la ejecución de un pila de código cuando un collision se detecta con un tipo específico de agente indicado en el selector desplegable. El agente con el que colisionó se conoce como el "colisionado". Este agente puede ser referenciado usando elcollidee bloquear.

Sintaxis

The On Collision With Block

Entradas:

  1. una raza del menú desplegable
  2. código relevante

Example

On Collision With Do example gif
On Collision With Do example code

When the fish prey agents collides with the whale predator agent (i.e. they have the same x, y, and z coordinates) the prey agent deletes itself. This interaction makes it appear as if the predator eats the prey.

Matices

En colisión con[▼] do no se puede usar como conditional como if. En colisión con [▼] do debe comenzar unstack de código.

Related Blocks