lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>You might try using a naming convention when the type isn't clear:
>
>ge_collision = function(self, x, y,whoIhitSprite)
>
>Or better yet:
>
>function ge_collisionAtX_Y_with_(self, x, y, aSprite)
>
>This way a developer who looks at the method's use doesn't has to look 
>at it's declaration to determine what the args are for.

You could also include something like

assert(aSprite.instanceOf("Sprite") );

As the first line of the method. As type checking is most important during
development you
could remove these lines for speed/size gains when ready for release.

lcs