(function() { var TestCube = function() { }; function printID(id, event) { print(id); } TestCube.prototype = { clickDownOnEntity: function(entityID, mouseEvent) { printID(entityID); } }; return new TestCube(); });