Skip to content

Tutorials: Classes & Fields

nova ✩ edited this page Oct 5, 2026 · 22 revisions

What is a class?

It's a kind of structure that holds it's own values and functions. You can make multiple instances of a class, each with its own data.

class ExampleClass:
    # still explaining

Creating an instance of a class

set {_myInstance} to new instance of ExampleClass
set {_myInstance} to new ExampleClass

Important

Class names must be written in TitleCase when referenced in any syntax. This is a pattern level requirement so you may not get a descriptive error.

Fields?

Fields are part of the class and can hold data, they accept a specified type and can optionally hold default values. Here is an example of a field

class Example:
    public counter: integer

The public modifier means we can access this field from anywhere (more on this later).

Now we can access the field like this:

set {_instance} to new instance of Example
increase {_instance}::counter by 1

We can also assign a default value to the field like this:

class Example:
   public counter: integer = 1

Next Page

Clone this wiki locally