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
is4v0g7hw43x47vi |
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 TimeTraveler = (function() { | |
var time, | |
def = function(value) { | |
var values = {}, | |
timeTraveler = { | |
get value() { | |
var lastTime = Object.keys(values) | |
.filter(function(pastTime) { | |
return pastTime < def.time; | |
}) |
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; |
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
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
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
{ | |
"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
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
s(".content", { | |
color : "blue", | |
backgroundColor : "purple" | |
}, [ | |
s(".sub-content", { | |
border : "2px solid black" | |
}) | |
]); |
OlderNewer