Difference between revisions of "Move Action"

From AgentCubes
Jump to navigation Jump to search
imported>Andri
imported>Andri
Line 11: Line 11:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td align="left" valign="top" width="80"><b>Example:</b></td>
+
<td align="left" valign="top" width="80"><b>Example 1:</b></td>
<td align="left" valign="top" width="100%">In the Frogger game, the Truck agent moves to the right once every half a second, as long as there is road there (second rule in the behavior below).
+
<td align="left" valign="top" width="100%"><b>same layer</b>: In the Frogger game, the Truck agent moves to the right once every half a second, as long as there is road there (second rule in the behavior below).
 
[[Image:Move action example.png|500px]]</td>
 
[[Image:Move action example.png|500px]]</td>
 +
</tr>
 +
<tr>
 +
<td align="left" valign="top" width="80"><b>Example 1:</b></td>
 +
<td align="left" valign="top" width="100%"><b>between layers</b>: In the 3D Matrix game, in its "Lift" method, the Nebuchadnezzar agent moves to the layer above it if the shift and up arrow key are pressed together and if at that position in the layer above, there is a Hole agent (first rule). Similarly, it moves to the layer below it if the shift and down arrow key are pressed together and if at that position in the layer above, there is a Hole agent (second rule).
 +
[[Image:Move action example2.png|500px]]</td>
 
</tr>
 
</tr>
  

Revision as of 21:24, 17 June 2011

150px

Definition: The move action moves an agent one cell in the direction indicated by the Direction parameter. If the dot (.) is selected, the agent will do nothing; it will leave the agent at its current position.
Parameters: direction
Example 1: same layer: In the Frogger game, the Truck agent moves to the right once every half a second, as long as there is road there (second rule in the behavior below). Move action example.png
Example 1: between layers: In the 3D Matrix game, in its "Lift" method, the Nebuchadnezzar agent moves to the layer above it if the shift and up arrow key are pressed together and if at that position in the layer above, there is a Hole agent (first rule). Similarly, it moves to the layer below it if the shift and down arrow key are pressed together and if at that position in the layer above, there is a Hole agent (second rule). Move action example2.png