Skip to content

Instantly share code, notes, and snippets.

View mzgoddard's full-sized avatar

Z Goddard mzgoddard

  • Bocoup
  • Boston, MA
View GitHub Profile
@mzgoddard
mzgoddard / abacus-api-notes.js
Created October 16, 2011 17:30 — forked from boazsender/abacus-api-notes.js
Abacus API Notes
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 October 21, 2011 19:16
Abacus.animation blog example
// 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 November 17, 2011 23:09
Prototypical Inheritance with Object.create
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 December 6, 2011 20:26
Animation State API
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 January 31, 2012 19:17
DerbyBullet API
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 February 1, 2012 17:20
DerbyNetwork API
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, {}))
@mzgoddard
mzgoddard / wrapper.js
Created February 1, 2012 19:04
New Wrapper
// 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);
};
@mzgoddard
mzgoddard / maildrop.js
Created May 10, 2012 15:46
Fat Arrow Funcs
// 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;
@mzgoddard
mzgoddard / gist:3123433
Created July 16, 2012 15:47
noshow12 notes

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

@mzgoddard
mzgoddard / gist:3242748
Created August 3, 2012 00:43
Cloud Management

Management Systems

Puppet

Written In

Ruby

Website

puppetlabs.com

License

???