Forward/en: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
[[Category:Movement]] | [[Category:Movement]] | ||
<section begin="image"/>[[File:Forward Block.png|alt=The forward block|thumb]]<section end="image"/> | <section begin="image"/>[[File:Forward Block.png|alt=The forward block|thumb]]<section end="image"/><p id="tooltip">Moves forward a specified number of steps.</p> | ||
<section begin="name" />'''{{Block|forward [_]}}'''<section end="name" /> is a [[code block]] part of the [[Movement]] drawer. | <section begin="name" />'''{{Block|forward [_]}}'''<section end="name" /> is a [[code block]] part of the [[Movement]] drawer. | ||
==Usage== | ==Usage== | ||
{{Block|forward [_]}} moves the [[agents|agent]] in [[Spaceland]] in the [[heading]] it is facing. The [[Engine#rendering|renderer]] [[Engine#tweening|tweens]] the movement such that it appears the agent changes location smoothly instead of instantaneous. | |||
==Syntax== | ==Syntax== | ||
[[File:Forward Nums.png|right|alt=The Forward Block|thumb]] | |||
<!-- <code>forward [number]</code> --> | <!-- <code>forward [number]</code> --> | ||
Inputs in this block: | Inputs in this block: | ||
#a number | #a number | ||
==Example== | |||
[[File:while_toggled_example.gif|alt=Forward example gif|thumb]] | |||
[[File:while_toggled_example.png|alt=Forward example code|thumb]] | |||
When the ‘forever’ button is toggled, the ‘turtle’ agents move forward by one step, while also turning randomly, allowing them to wander randomly throughout spaceland. | |||
== Nuances == | == Nuances == | ||
Line 22: | Line 32: | ||
*{{Block|up|up [_]}} | *{{Block|up|up [_]}} | ||
*{{Block|down|up [_]}} | *{{Block|down|up [_]}} | ||
*{{Block|Teleport To | *{{Block|Teleport To|teleport to x: [_] y: [_] z: [_]}} |
Latest revision as of 18:36, 16 August 2023
Moves forward a specified number of steps.
forward [_]
is a code block part of the Movement drawer.
Usage
forward [_]
moves the agent in Spaceland in the heading it is facing. The renderer tweens the movement such that it appears the agent changes location smoothly instead of instantaneous.
Syntax
Inputs in this block:
- a number
Example
When the ‘forever’ button is toggled, the ‘turtle’ agents move forward by one step, while also turning randomly, allowing them to wander randomly throughout spaceland.
Nuances
Because of the tweening effect, certain interactions can cause confusion. Click here to read more on how tweening can create confusing scenarios.