How to Make Code Work Together

Hi, I want to make enemies that can spawn on a specific place and then follow the player when they enter its radius. I have code for each feature that wok on their own, but when I try to add them to the same project they don’t work. I’d appreciate any advice or tips on why this isn’t working and how to fix it. I don’t mind having to make completely different code.

Game Link: https://arcade.makecode.com/S06666-01683-09087-05960
(block code)

1 Like

Enemies spawn and will follow the player if that’s whats supposed to to happen

1 Like

Use the sprite utils extension:
jwunderl/arcade-sprite-util
copy this into your search on the extension page.
there should be a block that checks for sprite distance from another sprite.

Thanks!