Skip to content

Instantly share code, notes, and snippets.

View jdlrobson's full-sized avatar

Jon Robson jdlrobson

View GitHub Profile
@jdlrobson
jdlrobson / toucan.js
Created September 8, 2011 22:18
Toucan Creature (Javascript jungle)
/**
* @see https://github.com/asyncjs/Javascript-Jungle/wiki/api
*/
//TODO: add to creatures.js instead..
var creature = jj.createCreature('toucan', function (layer) {
$ = jj.jQuery;
var jungle = $(layer.el).parent();
var jungleWidth = jungle.width();
var jungleHeight = jungle.height();
var jungleBounds = { left: 0 - 50, right: jungleWidth + 50 }