Basics
Guides
API Reference
Basics
Guides
API Reference
[26:7] extends: CollisionHandler
Wraps FXGL's CollectibleHandler (com.almasb.fxgl.dsl.handlers.CollectibleHandler), a CollisionHandler subclass that handles the common pattern of a collector picking up a collectible: optional sound is played, a callback runs, and the collectible is removed. Register with the running game's PhysicsWorld (fxgl.getPhysicsWorld().addCollisionHandler in chunk 6). Example: h = new CollectibleHandler("player", "coin", "pickup.wav", ::collectCoin); physicsWorld.addCollisionHandler(h.obj); public collectCoin(coin) { fxgl.inc("score", 1); }
CollectibleHandler (string CollectorType, string CollectibleType, string SoundName = "", callback OnCollect = null)
Creates a new CollectibleHandler.
CollectorType is the collector entity type.CollectibleType is the collectible entity type.SoundName is an asset name played on pickup (empty for no sound).OnCollect is an optional callback (collectible) -> any.adopt (object Ajo)
Wraps an existing CollectibleHandler AussomJavaObject.
noop (c)
Internal: zero-effect default action.

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