☄️
SpaceTode
  • Introduction
  • Element
  • Properties
  • Data
  • Arguments
  • Rules
  • Diagrams
  • Inputs
  • Outputs
  • Transformations
  • Symmetries
  • Symbols
  • Event Arguments
  • Maybe
  • Point of View
  • Actions
  • Mimic
  • Sub-Elements
  • Blocks
  • Scoping
  • JavaScript
  • Behave
  • Tabs and Spaces
Powered by GitBook
On this page

Actions

PreviousPoint of ViewNextMimic

Last updated 4 years ago

Was this helpful?

CtrlK

Was this helpful?

Use the action keyword to give actions to an element. Actions don't end an atom's behaviour when they match (like rules do).

element Dropper {
    change S () => new Sand()
    
    // Drop some sand below me
    action {
        @ => @
        _    S
    }
    
    // Afterwards... move into space
    any(xyz.directions) @_ => _@
}