# Sprite "Group" Simplification help

**URL:** <https://forum.makecode.com/t/sprite-group-simplification-help/41546>\
**Category:** Help\
**Tags:** game\
**Created:** [January 16, 2026, 5:32am UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546 "2026-01-16T05:32:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MasonTheLitten](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/masonthelitten/32/24867_2.png) [@MasonTheLitten](https://forum.makecode.com/u/MasonTheLitten)\
**Post date:** [January 16, 2026, 5:32am UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/1 "2026-01-16T05:32:39Z")

</div>

hello!  
i need help figuring out a way to “Group” sprites together and apply the same properties to all of them. Copying and Pasting over and over is mighty inconvinient, and very ugly to look at:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/7/c7781eb418dd8505c1effce3af7329a85f57b367.png)  
i attempted to use arrays like this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/6/d66f6a7d303a3a55246d78e584ee4647b577ab90.jpeg)

and then using the “list” variable instead of the others induvidually, but i get a lot of errors about sprite kinds.  
Help please!

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [January 16, 2026, 5:48pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/2 "2026-01-16T17:48:05Z")

</div>

Use an array for colors and instead of multiple images use the image recolor function to easily recolor from the same image. Also use a for element block.

---

<div class="post-metadata">

**Author:** ![IceyDomain](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/iceydomain/32/18326_2.png) [@IceyDomain](https://forum.makecode.com/u/IceyDomain)\
**Post date:** [January 16, 2026, 5:53pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/3 "2026-01-16T17:53:53Z")

</div>

Can you send the game link? Also, the picture you posted is blurry, so I can’t see what’s going on

---

<div class="post-metadata">

**Author:** ![BitBot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bitbot/32/33272_2.png) [@BitBot](https://forum.makecode.com/u/BitBot)\
**Post date:** [January 16, 2026, 7:16pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/4 "2026-01-16T19:16:14Z")

</div>

Here is small demo of grouping sprites!

> **[Sprite Group](https://arcade.makecode.com/S54474-54084-79886-35737)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![MasonTheLitten](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/masonthelitten/32/24867_2.png) [@MasonTheLitten](https://forum.makecode.com/u/MasonTheLitten)\
**Post date:** [January 16, 2026, 7:24pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/5 "2026-01-16T19:24:24Z")

</div>

im still a noob to block coding, so im going to need a visual explanation if thats not too much trouble

---

<div class="post-metadata">

**Author:** ![MasonTheLitten](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/masonthelitten/32/24867_2.png) [@MasonTheLitten](https://forum.makecode.com/u/MasonTheLitten)\
**Post date:** [January 16, 2026, 7:45pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/6 "2026-01-16T19:45:39Z")

</div>

Heres the project  
The link will be updated every few hours (im actively working on it)

https://arcade.makecode.com/#sandbox:88461-78002-00525-00559

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [January 16, 2026, 11:07pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/7 "2026-01-16T23:07:37Z")

</div>

theres many things you can optimise with functions and looping code

firstly, instead of a huge list changing each tile individually, you can just loop a section of code and change the x pos by 1 each time. Because the loop has no delay it all happens instantanously  
(note that I add +1 because the index value starts at 0)

 ![original list code](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/b/8b8617e75b93810373af2b71a27b75dfa45ca3ff.png)  
 ![looping code](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/7/b72012967f5cd320cb92c28698d050cffe585693.png)

Something many beginners struggle with is using sprites effectively, I always see many different sprite variables being used when it could all be one variable.

To remove the huge list we can use a function. Functions are a way to loop a custom section of code. But the magic is that we can add parameters to adjust them.  
For example:  
Say we made a function to make a red apple. Without adding a parameter, the function can only make red apples. But if we wanted green apples as well, we could just add a parameter controlling colour so that we could reuse our function and make actually any colour we wanted.

 ![function](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/a/1/a14e07fd9185ea74427494b9a99e906beba13db6.png)  
 ![function with parameter](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/c/6c219279a80cbae4f1b09ef705a70f06ae91003a.png)

back to the original code →   
Here i have taken advantage of the fact that colours = numbers in code. By plugging into the index into our function, we get a different colour each cycle of the loop. Thus, 8 different sprites are made. Again we have to +1 since while our colours start at 1, our index starts at 0.

 ![original code](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/0/9056bc2f97e3157cc878947880794c4fe5a7b3ec.png) ![functioned code](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/9/994e72dd736fe5e6dfd477db01370aea72149f2c.png)  
 ![looping the function](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/5/c5496fa8a41ffb13d43bb08a21ac665c2b663332.png)

> **extra**
>
> also the only reason why i added this is because its fun to make random things deterministic (if you input the same seed the exact same outcome will happen!) This could be useful for stuff like remaking the same set of random outcomes and saving games
> 
> ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/5/65141ca37bf449aea9639823c27b7806ca1e6e76.png)

---

<div class="post-metadata">

**Author:** ![MasonTheLitten](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/masonthelitten/32/24867_2.png) [@MasonTheLitten](https://forum.makecode.com/u/MasonTheLitten)\
**Post date:** [January 17, 2026, 3:22am UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/8 "2026-01-17T03:22:56Z")

</div>

This is very helpful!!!  
Thank you so much :]

---

<div class="post-metadata">

**Author:** ![MasonTheLitten](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/masonthelitten/32/24867_2.png) [@MasonTheLitten](https://forum.makecode.com/u/MasonTheLitten)\
**Post date:** [January 17, 2026, 3:23am UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/9 "2026-01-17T03:23:27Z")

</div>

For the funtions and changing color, will i have to define the color variable before i add the parameter to the function?

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [January 17, 2026, 11:27pm UTC](https://forum.makecode.com/t/sprite-group-simplification-help/41546/10 "2026-01-17T23:27:13Z")

</div>

No, the index variable doesn’t need to be defined
