# Crowd control

**URL:** <https://forum.makecode.com/t/crowd-control/39862>\
**Category:** Help\
**Tags:** game\
**Created:** [October 20, 2025, 12:59am UTC](https://forum.makecode.com/t/crowd-control/39862 "2025-10-20T00:59:44Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 20, 2025, 12:59am UTC](https://forum.makecode.com/t/crowd-control/39862/1 "2025-10-20T00:59:44Z")

</div>

How do I consistently apply all of these conditions to all sprites of the same?

> **[475263](https://arcade.makecode.com/S22112-75069-52608-37045)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Everytime only the latest sprites(I think) of that name abide by the conditions and the others don’t change at all.

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 21, 2025, 3:50pm UTC](https://forum.makecode.com/t/crowd-control/39862/2 "2025-10-21T15:50:32Z")

</div>

any breakthroughs?

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [October 21, 2025, 5:13pm UTC](https://forum.makecode.com/t/crowd-control/39862/3 "2025-10-21T17:13:40Z")

</div>

I dont quite understand your question but here is my best general explanation:

-When you assign a variable to a sprite, it becomes that sprite. Assigning the same variable to another sprite makes the variable now only be the latest sprite. To fix this, use sprite kinds to tell apart multiple sprites of the same kind and apply logic to them.

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 22, 2025, 5:32pm UTC](https://forum.makecode.com/t/crowd-control/39862/4 "2025-10-22T17:32:38Z")

</div>

how do I make all of a sprite kind follow a sprite

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [October 22, 2025, 9:36pm UTC](https://forum.makecode.com/t/crowd-control/39862/5 "2025-10-22T21:36:56Z")

</div>

Use “for element value of list” in the loops category, replace “list” with “array of sprites of kind player” block in the sprites tab, inside the loop add “myenemy follow mysprite”, replace “myenemy” with the drag-able “value” from the loop.

Heres some example code:

 ![1000078652](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/4/04310de9ff9d1ca7cb0ea346206fd5c53230f605.jpeg)

(In this case it also randomises the sprites position)

Heres an example project:

> **[test](https://arcade.makecode.com/17287-24282-22876-85928)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

You can also use the “on sprite of kind player overlaps othersprite of kind enemy” block in the sprites tab like the project above does to figure out thing like bullets destroying sprites.

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 23, 2025, 4:34am UTC](https://forum.makecode.com/t/crowd-control/39862/6 "2025-10-23T04:34:33Z")

</div>

thank you, also how do I track the distance between the player and all sprites of one kind

---

<div class="post-metadata">

**Author:** ![Ima.notarobot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ima.notarobot/32/26551_2.png) [@Ima.notarobot](https://forum.makecode.com/u/Ima.notarobot)\
**Post date:** [October 23, 2025, 4:44pm UTC](https://forum.makecode.com/t/crowd-control/39862/7 "2025-10-23T16:44:52Z")

</div>

You can use the sprite utils extension! It has everything you need to work with multiple sprites of the same kind. not only that it has a block that asks the distance between the 2. [https://github.com/jwunderl/arcade-sprite-util](https://github.com/jwunderl/arcade-sprite-util) if you need more help on this help just ask me, I struggled at first but then I got help with a similar issue.

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 23, 2025, 10:00pm UTC](https://forum.makecode.com/t/crowd-control/39862/8 "2025-10-23T22:00:34Z")

</div>

how do I make this work

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/4/3/43fe07a151c6a3db63e78b8c70035b2f9f750662.png)

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [October 23, 2025, 10:08pm UTC](https://forum.makecode.com/t/crowd-control/39862/9 "2025-10-23T22:08:45Z")

</div>

Use for element value of list, replacing list with the “get all sprites of kind spearman within 50 pixels from mysprite” block. Kinda like this:

 ![1000078832](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/0/901b37ef3b4e7283355f2fc5c67411d694aa2046.jpeg)

Example project:

> **[test](https://arcade.makecode.com/78889-40322-84901-57152)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

In this project, enemies only follow you when you come near.

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 23, 2025, 11:39pm UTC](https://forum.makecode.com/t/crowd-control/39862/10 "2025-10-23T23:39:06Z")

</div>

thank you

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 24, 2025, 4:21am UTC](https://forum.makecode.com/t/crowd-control/39862/11 "2025-10-24T04:21:01Z")

</div>

there’s something wrong with my code but the debug won’t work

> **[475263](https://arcade.makecode.com/S22112-75069-52608-37045)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [October 25, 2025, 5:38pm UTC](https://forum.makecode.com/t/crowd-control/39862/12 "2025-10-25T17:38:24Z")

</div>

Its this.

 ![1000078907](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/3/23f60590b4a9735213838a6eb947cd08f1423e70.jpeg)

Here you try to read the variable “magemen” (assigned to a sprite) as a statusbar, wich does not work.

---

<div class="post-metadata">

**Author:** ![BUM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bum/32/22127_2.png) [@BUM](https://forum.makecode.com/u/BUM)\
**Post date:** [October 25, 2025, 6:21pm UTC](https://forum.makecode.com/t/crowd-control/39862/13 "2025-10-25T18:21:27Z")

</div>

what does this mean

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/9/e9502cf3acd9dec9bae328b2faa74cdaca25179a.png)

Every time I fix one problem another one shows up from nowhere

> **[475263 - Copy](https://arcade.makecode.com/S89155-57225-68632-68220)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [October 25, 2025, 6:25pm UTC](https://forum.makecode.com/t/crowd-control/39862/14 "2025-10-25T18:25:09Z")

</div>

You can also use the element value loop along with my sprite basics extension (it has a proximity block)

> **[GitHub - EugeneRedwing8/arcade-sprite-basics: A MakeCode project](https://github.com/eugeneredwing8/arcade-sprite-basics)**
>
> A MakeCode project

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [October 27, 2025, 4:46am UTC](https://forum.makecode.com/t/crowd-control/39862/15 "2025-10-27T04:46:40Z")

</div>

The problem is the image is messed up; it shouldn’t be this (…) block.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/e/ded6a3e4bc71fb890064ff5373d750ef338a65ed.png)  
To fix this go to the images tab under advanced and find this block:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/9/e96f534e1492c1a5ea1005fa7fb4d829af1211d9.png)  
And drag it into the gray (…) block.
