file: CollisionHandler.aus

class: CollisionHandler

[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) { ... }

Methods