Move Action (german)

From AgentCubes
Jump to navigation Jump to search

Move.png

Move expanded.png

Definition: Bewege den Agenten eine Zelle in die angegebene Richtung.
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