chris-allnut - When you do “self=nil” in your example, you’re not actually setting the ‘newbullet’ to nil. As SegaBoy mentioned, table functions run the same as anonymous functions that are passed “self” for the first argument – “self” is automatically declared locally (as reference to the function’s parent table), when the table function runs. However, ownership can be re-assigned through dot notation (also known as “decorating”/ “inheritance”). That’s why I leave creation and destruction of instances up to the Class, not the (instances themselves).
thomas6 - Try to define functions with colon notation when you feel that an object should own the function (i.e. when something needs to move, jump, etc). and define functions with dot notation if they need to be assigned late, locally (temporary), to change ownership (decorate/ inherit), or when ownership is clearly not needed.
Thanks for all the good words, it totally make writing the tutorials worth while! [import]uid: 36792 topic_id: 34539 reply_id: 138004[/import]