Difference between revisions of "See-a Condition"

From AgentCubes
Jump to navigation Jump to search
imported>Corrina
imported>Corrina
 
Line 5: Line 5:
 
{| cellpadding="10" cellspacing="0" border="0" width="100%"
 
{| cellpadding="10" cellspacing="0" border="0" width="100%"
 
|-
 
|-
| align="left" valign="top" width="80" | '''Definition:'''
+
| align="left" valign="top" width="80" | '''Definition:'''  
 
| align="left" valign="top" width="100%" |  
 
| align="left" valign="top" width="100%" |  
The '''See-A''' condition: checks if the agent at the cell indicated by the [[Direction parameter]] is of the class specified in the [[Agent Class Name parameter]].
+
The '''See-A''' condition: checks if the agent at the cell indicated by the [[Direction parameter]] is of the class specified in the [[Agent Class Name parameter]].  
  
====== In contrast to the [[See Condition]], the See-a condition picks out all the shapes of a given agent. Use it to identify an agent regardless of the way it looks. ======
+
====== In contrast to the [[See Condition]], the See-a condition picks out all the shapes of a given agent. Use it to identify an agent regardless of the way it looks. ======
  
 
|-
 
|-
| align="left" valign="top" width="80" | '''Parameters:'''
+
| align="left" valign="top" width="80" | '''Parameters:'''  
 
| align="left" valign="top" width="100%" |  
 
| align="left" valign="top" width="100%" |  
[[Direction parameter|direction]]:''the direction to look for the target agent''
+
[[Direction parameter|direction]]: ''the direction to look for the target agent''  
  
[[Agent Class Name parameter|agent class name]]:''the type of agent to look for''
+
[[Agent Class Name parameter|agent class name]]: ''the type of agent to look for''  
  
 
|-
 
|-
| align="left" valign="top" width="80" | '''Optional Parameters:'''
+
| align="left" valign="top" width="80" | '''Optional Parameters:'''  
 
| align="left" valign="top" width="100%" | [[Layer parameter]]: ''the See-a condition can check to see if the specified agent exists in a layer other than the current layer the agent resides on.''
 
| align="left" valign="top" width="100%" | [[Layer parameter]]: ''the See-a condition can check to see if the specified agent exists in a layer other than the current layer the agent resides on.''
 
|-
 
|-
| align="left" valign="top" width="80" | '''Example:'''
+
| align="left" valign="top" width="80" | '''Example:'''  
 
| align="left" valign="top" width="100%" | If the Frog agent in the Frogger game sees a Truck agent to its left (no matter how the truck looks like), it will collide with it and plays a sound, changes to look like the dead frog, waits half a second, erases itself, decrements the Lives counter and broadcasts to the frog_generator to create a new Frog at the start. [[Image:See a condition example.png|500px|See a condition example.png]]
 
| align="left" valign="top" width="100%" | If the Frog agent in the Frogger game sees a Truck agent to its left (no matter how the truck looks like), it will collide with it and plays a sound, changes to look like the dead frog, waits half a second, erases itself, decrements the Lives counter and broadcasts to the frog_generator to create a new Frog at the start. [[Image:See a condition example.png|500px|See a condition example.png]]
 
|}
 
|}
  
 
[[Category:AgentCubes_Conditions]]
 
[[Category:AgentCubes_Conditions]]

Latest revision as of 01:16, 21 April 2012

See a condition.png

See a condition additional params.png

Definition:

The See-A condition: checks if the agent at the cell indicated by the Direction parameter is of the class specified in the Agent Class Name parameter.

In contrast to the See Condition, the See-a condition picks out all the shapes of a given agent. Use it to identify an agent regardless of the way it looks.
Parameters:

directionthe direction to look for the target agent

agent class namethe type of agent to look for

Optional Parameters: Layer parameter: the See-a condition can check to see if the specified agent exists in a layer other than the current layer the agent resides on.
Example: If the Frog agent in the Frogger game sees a Truck agent to its left (no matter how the truck looks like), it will collide with it and plays a sound, changes to look like the dead frog, waits half a second, erases itself, decrements the Lives counter and broadcasts to the frog_generator to create a new Frog at the start. See a condition example.png