[racket] Codify

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Thu Oct 27 12:27:42 EDT 2011

> It wasn't clear to me from the video how someone programs the behavior of
> the games.  I wonder whether that is currently slick visual programming, or
> it's pretty much traditional programming (albeit with text editor features
> like a pop-up color chooser).

I've got it downloaded and have looked at it.  It looks nice, and has
quite a few interesting programming examples.

As for the editor itself, it's the latter: the main interface is a
text editor; it is project-oriented, and a project can contain several
Lua files.  The program editor has support to pick sprites, images,
and sounds, by activating graphical pickers when you type specific
function names.  For example, if you type "fill()", the editor will
automatically insert a little graphical color picking widget in the
parens.

The program model is hardcoded to real-time games, with a traditional
game timer loop.  I think it's running at 30 frames a second, from
looking at some of the example code.  Programs are expected to define
at least two functions:  setup(), for initialization, and draw(),
which is called on every clock tick.  Being an iPad-oriented
interface, it has support for the accelerometer and touch.

There's a global canvas which you draw with the functions in
http://twolivesleft.com/Codify/Reference/#functions/index/graphics.
No image-based algebra, as far as I can tell.

There's an implicit double-buffered canvas.  I can see this due to a
bug in the environment: if you run a game program like Bit Invader,
exit it, and then run a traditional hello world program which doesn't
touch the canvas, then you'll see a flickering background of the Bit
Invader game switching between the two image buffers that implement
double-buffering.

As far as I can tell, there's no relation to the Web.  Programs in
Codify appear to depend on a Lua-running context.



Posted on the users mailing list.