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
Animal - this {} | |
Animal - debug: [ muppet , bert ] | |
Hello, my name is bert and I am a muppet | |
returned: { species: 'muppet', name: 'bert' } | |
**************************************** | |
Muppet - this {} | |
Muppet - debug: [ ernie ] | |
Animal - this {} | |
Animal - debug: [ muppet , ernie ] | |
Hello, my name is ernie and I am a muppet |
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
// Less pretty syntax, super simple to implement, generic reusable implementation | |
flow.exec( | |
function () { | |
new Entity().addComponent('level', this) | |
}, | |
function (err, level) { | |
level.addComponent('level-segment', 'something.json', this) | |
}, | |
function (err, level) { | |
level.addComponent('level-segment', 'something-else.json', this) |
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
/* | |
* This is the customized options file for nodelint.js being run through TextMate. | |
* Properties listed here will override the default properties within nodelint.js options. | |
* Commented out properties are the same in the default configuration. | |
* predef handles global variables used throughout different frameworks. | |
* | |
* Changes released into the Public Domain by tav <tav@espians.com> | |
* Options support added by Corey Hart <corey@codenothing.com> | |
* | |
*/ |
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
/** | |
* Used to create a new Vector2 | |
* @param float x Contains the x coord | |
* @param float y Contains the y coord | |
*/ | |
function Vector2(x, y) { | |
this.x = x; | |
this.y = y; | |
} |
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
Entity = Compose( | |
function () { | |
// fake a unique id | |
this.id = Math.floor(Math.random() * 1000); | |
}, | |
{ | |
a: function () { | |
return this.id; | |
} | |
} |
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
/* RequireJS Use Plugin v0.1.0 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* use.js may be freely distributed under the MIT license. | |
*/ | |
define({ | |
version: "0.1.0", | |
// Invoked by the AMD builder, passed the path to resolve, the require | |
// function, done callback, and the configuration options. | |
// |
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
/* RequireJS Use Plugin v0.1.0 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* use.js may be freely distributed under the MIT license. | |
*/ | |
define({ | |
version: "0.1.0", | |
// Invoked by the AMD builder, passed the path to resolve, the require | |
// function, done callback, and the configuration options. | |
// |
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
/* | |
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
so it's better encapsulated. Now you can have multiple random number generators | |
and they won't stomp all over eachother's state. | |
If you want to use this as a substitute for Math.random(), use the random() | |
method like so: | |
var m = new MersenneTwister(); |
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
function helloWorld () { | |
return "Hello, World!"; | |
} | |
function lorem () { | |
return "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; | |
} |
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
<image> | |
<source src="kitten-2x.png" density="2x"></source> | |
<source src="kitten-100.png" density="100h"></source> | |
<img src="kitten.png" /> | |
</image> |