Basics
Guides
API Reference
Basics
Guides
API Reference
[26:7] extends: CollisionHandler
Wraps FXGL's OneTimeCollisionHandler (com.almasb.fxgl.dsl.handlers.OneTimeCollisionHandler), a CollisionHandler subclass that fires its action on the first collision, then disables the collidable on the one-time entity so the pair never collides again. Register with the running game's PhysicsWorld (fxgl.getPhysicsWorld().addCollisionHandler in chunk 6). Example: h = new OneTimeCollisionHandler("player", "trap", ::springTrap); physicsWorld.addCollisionHandler(h.obj); public springTrap(player, trap) { ... }
OneTimeCollisionHandler (string EntityType, string OneTimeCollidableType, callback OnHit)
Creates a new OneTimeCollisionHandler.
EntityType is the generic entity type.OneTimeCollidableType is the entity type that becomes non-collidable after a single hit.OnHit is the callback (entity, oneTimeCollidable) -> any that fires on first collision.adopt (object Ajo)
Wraps an existing OneTimeCollisionHandler AussomJavaObject.
noop (a, b)
Internal: zero-effect default action.

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.