by Wouter van Oortmerssen
A language for making games.

Lobster is a game programming language. Unlike other game making systems that focus on an engine/editor that happens to be able to call out to a scripting language, Lobster is a general purpose stand-alone programming language that comes with a built-in library suitable for making games and other graphical things. It is therefore not very suitable for non-programmers.

  • Dynamically Typed with Optional Typing
  • Python-style indentation based syntax with C-style flavoring
  • Lightweight Blocks / Anonymous Functions that make any function using them look identical to built-in control structures supporting non-local return (& exception handling)
  • Lexically Scoped with optional Dynamic Scoping
  • Vector operations (for math and many other builtins)
  • Multimethods (dynamic dispatch on multiple arguments at once)
  • First Class Stackful Asymmetric Coroutines
  • Optionally immutable objects
include "vec.lobster"
include "color.lobster"
 
directions := [ vec_0, vec_x, vec_y ]
 
function sierpinski(depth):
    if(depth):
        gl_scale(0.5):
            for(directions) d:
                gl_translate(d):
                    sierpinski(depth - 1)
    else:
        gl_polygon(directions)
 
if(!gl_window("sierpinski", 256, 256)):
    while(gl_frame()):    
        if(gl_wentdown("escape")): return
        gl_clear(color_black)
        gl_scale(gl_windowsize())
        sierpinski(6)
Information updated 01/22/14
View Comments