walk

From Wiki of ZZT
Revision as of 23:20, 10 February 2021 by Rbts (talk | contribs) (Created page with "{{DISPLAYTITLE:walk}} '''walk''' is a ZZT-OOP command that makes an object move automatically, independent of conventional movement commands (<code>#go</code>,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


walk is a ZZT-OOP command that makes an object move automatically, independent of conventional movement commands (#go, #try).

Once #walk is executed, the object will move in the specified direction on every cycle tick. If a walking object is blocked by an obstacle, it will send a thud message to itself, unless it's locked.

To stop walking, use #walk idle or #walk i.


Syntax

#walk <direction>


Notes

  • Objects will not push other entities as a result of walking.
  • #walk operates independently of other movement commands, so an object can appear to move diagonally by walking along one axis and using #go or #try on the other.
  • flow refers to an object's current walking direction, and can be used in conjunction with Direction modifiers to steer it. For example, #walk cw flow will make an object turn clockwise.
  • Internally, ZZT object walking is implemented with two delta variables. Modifying these variables with an enhanced editor beyond the ranges of -1 to +1 will cause the object to skip across terrain.