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
// A task runner that calls the Typescript compiler (tsc) and | |
// Compiles a HelloWorld.ts program | |
{ | |
"version": "0.1.0", | |
// The command is tsc. Assumes that tsc has been installed using npm install -g typescript | |
"command": "rustc", | |
// The command is a shell script |
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
var x = require("xule"); | |
x.scene(document.body, { | |
controller : function() { | |
var ctrl = this; | |
ctrl.player = { x : 5 }; | |
}, | |
step : function(ctrl) { | |
if(x.key("w")) { | |
ctrl.player.x++; |
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
s(".content", { | |
color : "blue", | |
backgroundColor : "purple" | |
}, [ | |
s(".sub-content", { | |
border : "2px solid black" | |
}) | |
]); |
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
var m = require("mithril"); | |
module.exports = function Component(ctrl) { | |
var foo = ctrl.Component.foo = m.prop(5); | |
ctrl.Component.clicked = function() { | |
ctrl.Component.foo(++foo); | |
}; | |
return function ComponentView() { |
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
{ | |
"c" : [ "components/test.js", "components/test2.js"], | |
"e" : [{ | |
"i" : "test", | |
"c" : { | |
"test" : { "test" : true }, | |
"test2" : {} | |
}, | |
"e" : [{ | |
"i" : "bar", |
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
Component = { | |
entitiesAttached : [], | |
call : function(message) { | |
// first give the component a shot | |
if(typeof this[message.n] === "function") { | |
this[message.n](message); | |
} | |
// then its attached versions | |
if(typeof this.e[message.n] === "function") { |
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
data.components.reduce(function(prev, componentPath) { | |
Vx.Loaders.script(componentPath, prev); | |
return prev; | |
}, function() { | |
if(++loaded >= toLoad) { | |
// Components ready | |
world.state = 1; | |
// Entities ready | |
this.readyListeners.forEach(function(fn) { |
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
var anim = this.getComponent(Txl.c.Animation); | |
anim.add("bebop", new Txl.easing.InOut({properties})); | |
anim.play("bebop", 5000); |
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
var anim = this.getComponent(Txl.c.Animation); | |
anim.add("bebop", new Txl.easing.InOut({properties})); | |
anim.play("bebop", 5000); |
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
export import Game = require("game"); | |
export import Scene = require("scene"); | |
export import Utils = require("utils"); | |
// these need broken up | |
import iEntity = require("entity"); | |
import iTiles = require("components/tiles"); | |
// setting up a nice wrapper | |
export var TileMap = iTiles.TileMap; |