Teleport-To Action

From AgentCubes
Revision as of 22:57, 4 April 2012 by imported>Mike
Jump to navigation Jump to search

Teleport.png

Teleport2.png

Definition: The teleport to action will move the agent to the specified row, column and layer.  Also, the user may optionally specify a specifc world to teleport to, in this case, the agent will be removed from its current world, and will be displayed at the specified row, column and layer in whatever world has been specified. 
Parameters: row, column
Additional Parameters: layer, world, animation, time: the teleport to action can move an agent in a layer other than the current layer the agent resides on; by default it teleports the agent inside the current world but it can also teleport the agent to other worlds in the same project;  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.
Example 1:

teleport in the Current World: This agent is programmed to teleport to row 0 column 0 and layer 7 of its Current World it is stacked above a teleporter agent.

Teleport-example5.png

Example 2:

teleport to another world: This agent is programmed to teleport to row 1 column 1 and layer 0 in level2 when the agent is stacked above the goal agent.  When the agent moves onto the goal it will be teleported to level2 with all of its attributes in tact and it will be removed from its current world.  This is useful for transitions between different levels our world sections.

Teleport-example3.png

Hint:

Inside the print and say actions you may use ~self.row, ~self.column and ~self.layer to print an agent's row column and layer.  Trying selecting an agent and making a print action such as the one shown below and pressing the test button. 

Row-col-layer-print.png

In this print action we are print the agent's row column and layer (as seen in the status bar of the screenshot below). 

Example 2