Add enemies
Enemies are prefabs with ContactDamage plus a movement component.
A spiky walker that cannot be stomped (jump over it):
{ "schemaVersion": "0.1", "id": "spiky", "tags": ["enemy"], "components": { "Transform": {}, "Sprite": { "texture": "sprite.enemies", "frame": 0, "tint": "#b0a0ff", "anchorX": 0.5, "offsetX": 8, "z": 18 }, "SpriteAnimation": { "animation": "walk" }, "Body": { "maxFallSpeed": 500 }, "Collider": { "w": 12, "h": 11, "offsetX": 2, "offsetY": 5, "layer": "enemy", "mask": ["player"] }, "Patrol": { "speed": 45, "turnAtLedges": true }, "ContactDamage": { "amount": 1, "stompable": false } }}A bat that swoops in a wide sine wave (Hover moves the Transform; no Body needed):
{ "schemaVersion": "0.1", "id": "bat", "extends": "bee", "components": { "Sprite": { "tint": "#8a6db0" }, "Hover": { "rangeX": 48, "rangeY": 20, "period": 4, "bobPeriod": 2 } }}extends merges the parent prefab’s components under these, so the bat keeps the bee’s collider and damage.
Stomps emit enemy:stomped; reward them with a rule.