Difference between revisions of "Move Action"

From AgentCubes
Jump to navigation Jump to search
imported>Mike
imported>Corrina
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[image:Move.png|150px]]
+
[[Image:Move.png|150px|Move.png]]  
  
[[image:Move expanded.png|150px]]
+
[[Image:Move expanded.png|150px|Move expanded.png]]  
  
<table cellpadding="10" cellspacing="0" border="0" width="100%">
+
{| cellpadding="10" cellspacing="0" border="0" width="100%"
<tr>
+
|-
<td align="left" valign="top" width="80"><b>Definition:</b></td>
+
| align="left" valign="top" width="80" | '''Definition:'''
<td align="left" valign="top" width="100%">The <strong>move</strong> 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.</td>
+
| align="left" valign="top" width="100%" | The '''move''' action: ''moves an agent one cell in the direction indicated.''
</tr>
+
|-
<tr>
+
| align="left" valign="top" width="80" | '''Parameters:'''
<td align="left" valign="top" width="80"><b>Parameters:</b></td>
+
| align="left" valign="top" width="100%" | [[Direction parameter|direction]]: ''specifies the direction for the agent to move.''
<td align="left" valign="top" width="100%">[[Direction parameter|direction]]</td>
+
|-
</tr>
+
| align="left" valign="top" width="80" | '''Additional Parameters:'''
<tr>
+
| align="left" valign="top" width="100%" |
<td align="left" valign="top" width="80"><b>Additional Parameters:</b></td>
+
[[Layer parameter|layer]]: ''specifies what layer the agent will move on.''
<td align="left" valign="top" width="100%">[[Layer parameter|layer]], [[Animation parameter|animation]], [[Animation time parameter|time]]: the move action can move an agent in a layer other than the current layer the agent resides on; it can animate the movement with accelerated or constant speed; and it can make the movement happen instantly (if time is 0) or it can take any amount of time to perform the animation. The slider() option in the time parameter connects the animation time to the slider located above the world, next to the other world controls.</td>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Example 1:</b></td>
 
<td align="left" valign="top" width="100%"><b>move on the 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>
 
</tr>
 
<tr>
 
<td align="left" valign="top" width="80"><b>Example 2:</b></td>
 
<td align="left" valign="top" width="100%"><b>move 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>
 
  
</table>
+
[[Animation parameter|animation]]: ''move with accelerated or constant speed.''
 +
 
 +
[[Animation time parameter|time]]: ''if time is 0, movement happens instantly. The slider() option in the time parameter connects the animation time to the slider located above the world.''
 +
 
 +
|-
 +
| align="left" valign="top" width="80" | '''Example 1:'''
 +
| align="left" valign="top" width="100%" | '''move on the 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). [[Image:Move action example.png|500px|Move action example.png]]
 +
|-
 +
| align="left" valign="top" width="80" | '''Example 2:'''
 +
| align="left" valign="top" width="100%" | '''move 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). [[Image:Move action example2.png|500px|Move action example2.png]]
 +
|}
  
 
[[Category:AgentCubes_Actions]]
 
[[Category:AgentCubes_Actions]]

Latest revision as of 21:06, 20 April 2012

Move.png

Move expanded.png

Definition: The move action: moves an agent one cell in the direction indicated.
Parameters: direction: specifies the direction for the agent to move.
Additional Parameters:

layer: specifies what layer the agent will move on.

animation: move with accelerated or constant speed.

time: if time is 0, movement happens instantly. The slider() option in the time parameter connects the animation time to the slider located above the world.

Example 1: move on the 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 2: move 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