Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Classes and Objects

José M. Meza Ortiz edited this page May 1, 2021 · 1 revision

Since tables in lua are already objects in many ways, LuaScript simply extends this functionality to try to resemble regular class traits in OOP languages.

Classes are then object constructors, which cluster together a predefined set of properties and methods that they pass onto objects on their creation.

Class declaration

To declare a new class you start by typing the keyword class followed by the name of the new class.

class Animal {
	...
}

logo LuaScript Docs

Documentation module for the LuaScript language.

The language
The library and the preprocessor

Clone this wiki locally