heyplay Welcome Play Create Explore Log in Log in

Editor documentation

Top Heyplay IOkit Blob

Acts as the actor of the game - with a defined appearance, capable of moving & colliding etc.

Properties
id
Unique identifier (internally it's an integer incremented from 1).
position
Position of the blob (its center).
size
Diameter of the blob (that is, double its radius).
velocity
Speed + direction vector to move the blob.
speed
Speed to move the blob with. Alias for `velocity.mag`.
dir
Direction to move the blob in. Alias for `velocity.dir`.
color
Color to fill the blob with. Represented with any CSS color string.
layer
Layer to display the blob at. Must be an integer from 0 (bottom, default) to 1000 (top).
category
Category that this blob belongs to and that other blobs may target in `collidesWith`.
collidesWith
A list of categories that this blob may collide with.
group
Group within which all blobs will never collide regardless of their category.
isStatic
Static body won't ever be affected by collisions with other bodies (but they will).
isSensor
Sensor won't ever take part in collisions with other bodies (but will detect them).
Methods
create Static
Create a blob with specified params, adding it to the game.
onCollision Static
Called when two blobs collide.
destroy
Destroy the blob, removing it from the game.