What it does
sprite.getHitTest reads HitTest on a sprite object. It takes id, x and y.
Signature
sprite.getHitTest(id, x, y)Arguments
idxy
Example · generated
function update(dt) { const id = sprite.create('/sprites/hero.png', 100, 120); const hitTest = sprite.getHitTest(id, 100, 120);}sprite.create is there to give the call something to act on; sprite.getHitTest is the line that matters. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.