Created
September 21, 2009 22:30
-
-
Save richtaur/190611 to your computer and use it in GitHub Desktop.
Quick JSDOC-like notation for describing objects in a Scribblenauts-type world (only better, that game is not great)
This file contains hidden or 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
// Quick JSDOC-like notation for describing objects in a Scribblenauts-type world (only better, that game is not great) | |
@param {String} name (eg. 'Zombie') | |
@param {Boolean} alive | |
@param {String} type ( | |
'animal', 'humanoid', 'insect', 'bludgeon weapon', 'projectile weapon', '...?' | |
) | |
@param {Object} alive { | |
@param {Number} aggression | |
@param {String} alignment (good|neutral|evil) | |
@param {Array} eats ??? | |
@param {Boolean} flight | |
@param {Boolean} gills ??? | |
@param {Array} needs ??? | |
@param {Array} pieces | |
[{ | |
(string) type : ('head', 'arm', 'leg', 'body', 'tail'), | |
(string) image : URL, | |
(number) x : coordinate, | |
(number) y : coordinate | |
}] | |
} (null if not alive) | |
// arrays of strings | |
@param {Array} elements | |
@param {Array} strong | |
@param {Array} weak | |
// random traits | |
@param {String} blood (hex color) | |
@param {Boolean} container | |
@param {Number} courage | |
@param {Boolean} floats (number, buoyancy?) | |
@param {Number} intelligence | |
@param {Boolean} ridable | |
@param {Number} speed | |
@param {Number} power | |
@param {Function} destroy // called when the object dies | |
@param {Function} ping // called every loop | |
@param {Function} use // called when this object is "used" | |
ping : function(sandbox) { | |
} | |
sandbox methods: { | |
create : creates a new object | |
getNearBy : ??? | |
getEnemies : ??? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment