☄️
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

Was this helpful?

Mimic

Elements can copy another element's rules (and actions) with the mimic keyword.

element Snow {
    colour "white"
    change W () => new Water()
    maybe(1/100) @ => W
    mimic(Sand)
}

This snow element melts 1% of the time. The rest of the time, it behaves like Sand.

PreviousActionsNextSub-Elements

Last updated 4 years ago

Was this helpful?