SolidTags
A set of up to 32 tags a game gives its solids, such as "bounce pad" or "ice", one bit each. Events.floorTagsOf reports the tags of the floors a particle stood on.
Build a set from single tags with of and plus: SolidTags.of(0) + SolidTags.of(3). bits holds tag i in bit i. toString lists the tag numbers in ascending order, as SolidTags(0, 3), and NONE prints as SolidTags().
Samples
val ice = SolidTags.of(0)
val lava = SolidTags.of(1)
val both = ice + lava
assertPrints(both, "SolidTags(0, 1)")
assertPrints(both.intersects(lava), "true")
assertPrints(ice.intersects(lava), "false")Content copied to clipboard