See-a Condition

From AgentCubes
Revision as of 17:05, 17 June 2011 by imported>Andri
Jump to navigation Jump to search

150px

150px

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. If the cell in the indicated direction contains an agent of the specified class, the See-a condition is true. Otherwise, the condition is false. 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: direction, agent class name
Optional Parameters: Layer parameter: the See 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 See Condition Example.png
Example 2: different layer:In its "remove above" method, if the Nebuchadnezzar agent in the 3D Matrix game sees a Matrix shame in the layer above it, it plays the Whip sound, removes the Matrix (erases the agent in the same x,y position, but the layer above it) and replaces it with a Hole agent.
See condition example 2.png