If you want to make this take a generic collide function, you don't need to pass in world- the collide function can simply be constructed to already have access to the world (via bind() or closure).