Skip to content

Instantly share code, notes, and snippets.

@AGoblinKing
Last active August 29, 2015 14:19
Show Gist options
  • Save AGoblinKing/901881c4e0a6eec9c52d to your computer and use it in GitHub Desktop.
Save AGoblinKing/901881c4e0a6eec9c52d to your computer and use it in GitHub Desktop.
Xule Idea
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++;
}
},
render : function(ctrl) {
return x("mesh", {
x : ctrl.player.x,
y : 0,
z : 0,
geometry : cube,
material : someRedStuff
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment