What's this

This is an experimental web-based program that allows you to write and test GML (GameMaker' language) right in your browser.

How does this work

I wrote a GML->JavaScript compiler that works close enough to one used in actual software.

Entered GML code is dynamically translated into JS code, and inserted into a running GameMaker: Studio' HTML5' game, which then interacts with it similar to how it would with code generated by GMS itself.

See the blog post for more information.

Writing code

Code is to be written quite closely to how you would in GameMaker itself.

To add scripts, enter #define scriptName, followed by the script' code.

Check out the sample program for a live example.

Supported functions

Majority of functions available in GameMaker are supported. Exceptions are:

  • Functions not available on GameMaker's HTML5 target (Steam, mobile APIs, etc.).
  • Legacy sound_ functions (use audio_!).
  • Spine-specific functions (since you can't load skeleton data dynamically).
  • alarm[] array (since you can't define alarm events for objects).

While execution speed is similar to that of GameMaker-produced code, this must not, by any means, be used to evaluate the toolkit's performance.

Differences from GML

The following are the differences in the language variant used here versus the regular GML:

  • Arrays are currently "create-on-write" (var m; m[0] = 1; creates an array), but not "copy-on-write" (var a, b; a[0] = 1; b = a; b[1] = 2; will modify the original array instead of making a copy).
  • Inline array declaration syntax is supported, meaning that you can do var m = [1, 2, 3];
  • Ternary operators are supported, meaning that you can do var text = visible ? "on" : "off";
  • "lightweight" (JS) objects are supported, meaning that you can do var q = { _x: 1 }; trace(q._x); instead of creating instances.
  • Chaining accessors m[|1][2] is allowed.
  • do { x } while (c) loops are supported along with regular while (c) { x } and do { x } until (c) loops.
  • JavaScript-specific debugger; statement is supported and will act like a breakpoint in JavaScript debugger if you have "developer tools" open.
  • Data URI scheme is supported for most I/O related functions, meaning that you can embed assets as base64 in code.
  • trace(...values) function is supported as a variable-argument-count to show_debug_message.
  • PointerLock extension functions are supported (if you need mouselook).

Keyboard shortcuts

Supported keyboard shortcuts are:

  • Standard keyboard shortcuts (cut, copy, paste, etc.)
  • Ace-specific keyboard shortcuts
  • Ctrl+Enter, F5: [re-]run game

Additional questions

If your question is not covered here, feel free to ask on the discussion board.