Classes and Instances | ||
SCI games are object oriented. The objects in SCI are called "classes" and "instances". Classes can be created from scratch, or based on other classes. Instances, however, must be derrived from a class. Classes can be accessed globally, while instances can only be directly accessed locally (within the same script). To globally access instances, you would have to store it's address in a global variable, and reference it from the variable. Classes and instances have two parts: properties and methods. Properties are 16 bit integers. They work just like other variables, but are attatched to objects. Methods are functions containing code which can be executed by the interpreter. They are declared just like procedures. To access the header of a class or instance, you can use object specific keywords. Class Syntax
Instance Syntax
|