Lua: Basic OO

From Mario Fan Games Galaxy Wiki
Revision as of 01:44, 9 December 2008 by Xgoff (talk | contribs) (blah i'll finish later)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Lua
Lua.gif
Basics
Intermediate
Advanced
XLua
Add to this template
 Standardwikimessagebox.png This article assumes the use of Lua 5.1.

Information may not be accurate or may need revision if you are using a different version.

 Stub.png This article or section is in need of expansion.

Please add further information.

Though Lua has no true class support, it is still possible to emulate object-oriented programming through various methods, usually metatables. However, metatables are not required to produce a basic implementation of OO. This program will function with the regular Lua executable, but the effects will be much easier to see with another host program like SDL or MMF2.

objects = {
    newID = 0,
    o = { },
}