two pager, bible, review copy,
two pager review copy - investors, quick feedback one page minimum bible - everything (really) documentation - included in bible, general documents
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 ) |
// alter euler angles | |
var rotate = Abacus.animation({ | |
// indices per second | |
rate: 0.3, | |
// loop infinitely | |
loop: true, | |
// linear interpolation between values | |
tween: 'linear' | |
}); |
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]; |
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 = { |
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)}) |
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, {})) |
// 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); | |
}; |
// 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; |