Prism¶
The prism module contains the core engine and commonly used utilities. Its classes and functions can
be accessed from the prism global, e.g. prism.Level.
Registries
Registries get automatically loaded by prism.loadModule(). They hold all of the game
objects, making them easy to access, e.g. prism.actors.Player().
Core
Functions
-
prism.loadModule(directory:
string)¶ Loads a module into prism, automatically loading objects based on directory. Will also run
module/module.luaormodule/init.luafor any other set up.- Parameters:
directory (
string) – The root directory of the module.
-
prism.loadModule(directory:
-
prism.advanceCoroutine()¶
Runs the level coroutine and returns the next message, or nil if the coroutine has halted.
-
prism.advanceCoroutine()¶
Core components
Core systems
Core relations
Messages & decisions
Behavior trees
Structures
-
alias PassableCallback = fun(x:
integer, y:integer, mask:Bitmask)¶
-
alias PassableCallback = fun(x:
Functions
-
prism.Ellipse(
mode: ("fill" | "line"),
center:Vector2,
rx:integer,
ry:integer,
callback?:PassableCallback
)¶ Generates points for an ellipse on a grid using the Vector2 class.
- Parameters:
mode (("fill" | "line")) – Whether to fill the ellipse or just an outline.
center (
Vector2) – The center of the ellipse.rx (
integer) – The radius on the x axis.ry (
integer) – The radius on the y axis.callback? (
PassableCallback) – An optional callback to determine passability.
-
prism.Ellipse(
-
prism.Bresenham(
x0:integer,
y0:integer,
x1:integer,
y1:integer,
callback:PassableCallback
)¶ Generates points for an ellipse on a grid using the Vector2 class.
- Parameters:
x0 (
integer) – The x coordinate of the first point.y0 (
integer) – The y coordinate of the first point.x1 (
integer) – The x coordinate of the second point.y1 (
integer) – The y coordinate of the second point.callback? (
PassableCallback) – An optional callback to determine passability.
-
prism.Bresenham(