Skip to content

Instantly share code, notes, and snippets.

@richtaur
Created September 21, 2009 22:30
Show Gist options
  • Save richtaur/190611 to your computer and use it in GitHub Desktop.
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)
// 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