Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael "Z" Goddard mzgoddard

View GitHub Profile
View abacus-api-notes.js
var mainLoop = Abacus.timer({
callback: function( data ) {
data.delta // time since the last tick
data.ticks // zero indexed number of ticks
}
});
// Start the timer with an optional kill time in miliseconds
// if no miliseconds are passed in, it wil run FOR EV AR, until you pause it
mainLoop.start( 10000 )
@mzgoddard
mzgoddard / animation-angle.js
Created Oct 21, 2011
Abacus.animation blog example
View animation-angle.js
// alter euler angles
var rotate = Abacus.animation({
// indices per second
rate: 0.3,
// loop infinitely
loop: true,
// linear interpolation between values
tween: 'linear'
});
@mzgoddard
mzgoddard / type.js
Created Nov 17, 2011
Prototypical Inheritance with Object.create
View type.js
function type(prototype, members, properties, objectMembers) {
var exports = {}, key;
properties = properties || {};
objectMembers = objectMembers || {};
exports.prototype = Object.create(prototype || {}, properties);
for ( key in members ) {
exports.prototype[key] = members[key];
@mzgoddard
mzgoddard / animation.js
Created Dec 6, 2011
Animation State API
View animation.js
function Animation( options ) {}
Animation.prototype = {
start: function( target ) { /* start new AnimationState */; return state; }
// move reset to state
// data related functions
sample: function( target, time ) { return this; }
}
function AnimationState( { animation: animation, target: target, timer: timer || undefined } ) {}
AnimationState.prototype = {
@mzgoddard
mzgoddard / api.js
Created Jan 31, 2012
DerbyBullet API
View api.js
Factory bullet.factory
Factory bullet.nacl
Factory bullet.bump
World Factory.world()
World bullet.world() /* maps to bullet.factory.world */
Car World.addCar({position: vector3, rotation: quaternion})
World.step(timedelta, function())
Car.fireGun({position: vector3, direction: vector3, callback: function({hit: Car, position: vector3)})
@mzgoddard
mzgoddard / network.js
Created Feb 1, 2012
DerbyNetwork API
View network.js
undefined network.step()
Network network.getNetwork()
function(self = Network, MsgInfo, User) Network.onnewuser
function(self = Network, MsgInfo, User) Network.ondeaduser
function(self = Network, MsgInfo, NetworkObject) Network.onnewobject
// message passing
Network.on('name', function(self = Network, {})
Network.once('name', function(self = Network, {}))
Network.off('name', function(self = Network, {}))
View wrapper.js
// this is an idea, a paradigm, not a function that is reused
// an example with World
wrapper.World = function(options) {
this.stuff = stuff;
};
bullet.world = function(options) {
return new wrapper.World(options);
};
View maildrop.js
// engine/object.js
this.task( () => {
var index = this.objects.indexOf( object );
if ( index != -1 ) {
if ( object.ongamedestroy )
object.ongamedestroy( this );
object.call( 'ongamedestroy', object, this );
object.game = null;
View gist:3123433

Docs

two pager, bible, review copy,

two pager review copy - investors, quick feedback

one page minimum

bible - everything (really) documentation - included in bible, general documents

View gist:3242748

Management Systems

Puppet

Written In:Ruby
Website:puppetlabs.com
License:???
You can’t perform that action at this time.