Object-Oriented Programming With Lua

Some of you are already aware of what programmers call OOP (Object-Oriented Programming). Some of you may know nothing about it. I’ll try to be as clear as I can here, to keep this simple for both groups.

First of all, I suggest you take a look at the Wikipedia page about OOP:

http://en.wikipedia.org/wiki/Object-oriented_programming

An object is a special type of variable bringing With it its properties (called fields) and its functions (called methods). We call this a “class.” It allows you to organize your code to create “objects” of the same behaviors, like ships, characters, robots, and so on.

The academic metaphor is the vehicle:

  • A vehicle has properties: color, weight, and so on.
  • A vehicle has ...

Get Create 2D Mobile Games with Corona SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.