Scarab
A thin, game-agnostic 2D engine host built on the sunlight tile-map engine
Loading...
Searching...
No Matches
Scarab::Engine::Lua::LuaCollisionApi Class Reference

Collision rule/handler registration Lua primitives. More...

#include <luacollisionapi.h>

Static Public Member Functions

static void Register (lua_State *pLuaState)
 Register the collision Lua-callable functions.
 

Detailed Description

Collision rule/handler registration Lua primitives.

Also implemented in src/lua/luacollisionlistener.cpp (the sole collision listener, decoding the packed handles a collision callback receives - no Lua-callable primitives of its own). Collision detection in this engine is entirely layer-based: you declare which pairs of Tiled layers should be checked against each other (collision_add_rule), and register one global handler function that's called whenever any two colliding sprites belong to a ruled-together pair. There's no per-sprite "on hit" registration — dispatch to the right game logic based on the two handles is entirely up to your handler.

Member Function Documentation

◆ Register()

void Scarab::Engine::Lua::LuaCollisionApi::Register ( lua_State *  pLuaState)
static

Register the collision Lua-callable functions.


The documentation for this class was generated from the following files: