Вы можете определить методы класса, поставив перед ними префикс @
:
class Box2DUtility
constructor: () ->
@drawWorld: (world, context) -> alert 'World drawn!'
# And then draw your world...
Box2DUtility.drawWorld()
Демо: http://jsfiddle.net/ambiguous/5yPh7/
И если вы хотите, чтобы ваш drawWorld
действовал как конструктор, тогдаВы можете сказать new @
так:
class Box2DUtility
constructor: (s) -> @s = s
m: () -> alert "instance method called: #{@s}"
@drawWorld: (s) -> new @ s
Box2DUtility.drawWorld('pancakes').m()
Демо: http://jsfiddle.net/ambiguous/bjPds/1/