Home

> 4D Blocks

> Version 3

  Controls
  Settings
  Examples
> Scene Language
  Kinds of Blocks
  Goals
  History
  Versions

  Constants
  Geometry Commands
  Train Commands

Scene Language

The scripting language used to describe scenes is stack-based, like PostScript or Forth. You can comment and uncomment things in C/C++ style. Brackets are used to define arrays. You can define arrays of any type, but arrays of numbers are especially useful since they can be used to represent geometric points and vectors.

There are enough commands that it's worth dividing them into sections.

Constants
Geometry Commands
Train Commands

The net result should be that the stack contains some shapes and/or a track object and some trains. What's left on the stack is what's displayed inside the game. Note: if you mix 3D and 4D objects on the stack, you will get cryptic errors.