# class

Creates a new class object.

**Kind:** Function

**Environments:** Game, Terrain

## Game

``` { .lua .api-signature }
class( base? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/Global.md#class)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `base` *(optional)* | table | An optional base class to inherit from. (Defaults to inheriting from no class) |

**Returns:**

| Type | Description |
| --- | --- |
| table | Class table. |

## Terrain

``` { .lua .api-signature }
class( base? )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/Global.md#class)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `base` *(optional)* | table | An optional base class to inherit from. (Defaults to inheriting from no class) |

**Returns:**

| Type | Description |
| --- | --- |
| table | Class table. |
