Basics
Guides
API Reference
Basics
Guides
API Reference
[27:7] extends: FxObj
Wraps an AussomCollisionHandler (subclass of FXGL's abstract CollisionHandler) so Aussom code can react to collisions between entities of named types. The two type strings passed to the constructor identify the colliding entity types and order the pair the callbacks receive. Register the resulting handler with the running game's PhysicsWorld (fxgl.getPhysicsWorld().addCollisionHandler in chunk 6). Example: h = new CollisionHandler("player", "enemy"); h.onCollisionBegin(::onPlayerHit); physicsWorld.addCollisionHandler(h.obj); public onPlayerHit(player, enemy) { ... }
CollisionHandler (string TypeA, string TypeB)
Creates a new CollisionHandler for the given pair of entity type strings. The handler fires only for collisions between the two types; entity A in callbacks always matches TypeA.
TypeA is the first entity type.TypeB is the second entity type.onCollisionBegin (callback Cb)
Registers the onCollisionBegin callback (fires the first tick the entities collide). The callback receives (entityA, entityB).
Cb is a callback that takes two Entity arguments.this objectonCollision (callback Cb)
Registers the onCollision callback (fires every tick the entities remain in contact). The callback receives the pair.
Cb is a callback that takes two Entity arguments.this objectonCollisionEnd (callback Cb)
Registers the onCollisionEnd callback (fires the tick contact ends).
Cb is a callback that takes two Entity arguments.this objectonHitBoxTrigger (callback Cb)
Registers an onHitBoxTrigger callback that fires when two entities' HitBoxes start overlapping. The callback receives (entityA, entityB, hitBoxA, hitBoxB).
Cb is a callback (entityA, entityB, boxA, boxB) -> void.this object
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.