This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Today I ported game{closure}'s animated trail example to coffeescript.
For anyone wondering, the work flow I'm using is:
Create a new game project:
$ cd ~/devkit/projects/
$ basil init <game-name>
Create a coffeescript directory:
$ mkdir ~/devkit/projects/<game-name>/coffee
Watch and auto-compile coffeescript to js and copy to the projects /src directory
$ cd ~/devkit/projects/<game-name>/coffee $ coffee --watch --compile --output ../src/ .
Run sdk web frontend
$ basil serve
Start hacking at your application.
$ emacs ~/devkit/projects/<game-name>/coffee/Application.coffee
And here is the code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yesterday a colleague pointed me a very interesting game engine called GameClosure that can compile Javascript and HTML down to native code for mobile devices.
Never wanting to touch Javascript after having discovered the wonders of CoffeeScript I took a quick look at how to get a hello-world example working with CoffeeScript & GameClojure... here's the code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports is backtick-escaped so as to render directly to javascript as the engine requires exports to have global scope.
CoffeeScript's implementation of inheritance replaces GameClosures 'Class(<super class>, func...' inheritance helper function (and is much nicer IMO) as seen in their javascript implementation of hello-world.
Hopefully it's this easy with, non-trivial, GameClosure applications.