# How do I optimize games on MakeCode Arcade?

**URL:** <https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179>\
**Category:** Arcade\
**Tags:** game, graphics-and-math\
**Created:** [February 16, 2026, 12:23am UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179 "2026-02-16T00:23:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kee](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@Kee](https://forum.makecode.com/u/Kee)\
**Post date:** [February 16, 2026, 12:23am UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/1 "2026-02-16T00:23:24Z")

</div>

There’s some methods that I think might work but I need some fact checking by other people. First making all the sprites that are off screen invisible. Functionally, invisible sprites only have 2 colors being transparent and non transparent since they can’t be seen however they can be hit with projectiles and melee attacks which only register for non transparent colors. So this reduces the amount of colors from 16 to 2 which probably boosts performance by a lot. Another thing is health bars. Health bars can be optimized even more extremely. Since health bars are visual, you can destroy the health bar of an enemy when they go off screen and create that health bar again when they come back on screen. And you can measure health of enemies via the sprite data extension which stores them to be able to remember them when recreating a health bar. These 2 optimization methods I need testing so any help would be greatly appreciated.

---

<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:** [February 16, 2026, 5:01am UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/2 "2026-02-16T05:01:02Z")

</div>

> **[GitHub - UnsignedArduino/Stats: A simple MakeCode Arcade extension to toggle stats...](https://github.com/UnsignedArduino/Stats)**
>
> A simple MakeCode Arcade extension to toggle stats on and off via blocks

this small extension will be pretty helpful to see what actually improves your performance. Something to note is that im pretty sure sprites are laggy no matter how many colours they use and that registering sprite overlaps are especially laggy.

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [February 16, 2026, 4:32pm UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/3 "2026-02-16T16:32:26Z")

</div>

At any point in your game do you change to a scene? (For example, entering a new tile map with none of the past sprites or entering a menu)

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [February 16, 2026, 4:34pm UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/4 "2026-02-16T16:34:23Z")

</div>

The status bar idea is a good one, and the number of colors a sprite uses has no effect on how laggy it is, as each pixel is handled individually and which color that pixel is has no effect on the time it takes to render. Luke is right that sprite overlaps are laggy. You could implement your own overlaps that are based on a square around the sprite, which would cause a lot less lag. This is technically a built in feature, as there is a Sprite flag called something like “use rectangle hitboxes”, but it is not exposed in blocks. I have put it into a block in my [JavaScript Extras](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766) extension. You could try that, but I think the extension adds a kinda insane amount of other stuff so just be prepared.

---

<div class="post-metadata">

**Author:** ![ahmad34](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@ahmad34](https://forum.makecode.com/u/ahmad34)\
**Post date:** [February 17, 2026, 5:18am UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/5 "2026-02-17T05:18:25Z")

</div>

Good ideas hiding or destroying off-screen stuff can help, but invisibility alone might not change much since the sprite still exists in memory. Recreating health bars on return sounds more impactful though. Definitely worth testing on a heavier game to see real gains.

---

<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:** [February 17, 2026, 6:46pm UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/6 "2026-02-17T18:46:25Z")

</div>

The problem with that is running through and checking the sprite positions every game update is pretty laggy lol

---

<div class="post-metadata">

**Author:** ![ahmad34](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@ahmad34](https://forum.makecode.com/u/ahmad34)\
**Post date:** [February 24, 2026, 6:51pm UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/7 "2026-02-24T18:51:47Z")

</div>

> [@WoofWoof](#):
>
> The status bar idea is a good one, and the number of colors a sprite uses has no effect on how laggy it is, as each pixel is handled individually and which color that pixel is has no effect on the time it takes to render. Luke is right that sprite overlaps are laggy. You could implement your own overlaps that are based on a square around the sprite, which would cause a lot less lag. This is technically a built in feature, as there is a Sprite flag called something like “use rectangle hitboxes”, but it is not exposed in blocks. I have put it into a block in my [JavaScript Extras](https://nulsbrawl.fr/) extension. You could try that, but I think the extension adds a kinda insane amount of other stuff so just be prepared.

Yeah that makes sense, overlaps always seem to be the main cause of lag in these projects.  
Using rectangle hitboxes sounds like a smart workaround, might actually help performance a lot.  
That extension sounds powerful but kinda heavy, still worth trying out though

---

<div class="post-metadata">

**Author:** ![Kee](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@Kee](https://forum.makecode.com/u/Kee)\
**Post date:** [April 6, 2026, 5:11pm UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/8 "2026-04-06T17:11:05Z")

</div>

Yeah. You can change floors in 2 maps. When that happens all the previous enemies get destroyed, so essentially they’re forgotten by the system. When you come back to that previous floor, it generates completely new enemies. The only things that aren’t destroyed are players and projectiles (since being able to shoot a projectile before entering and having it hit an enemy from the next floor is pretty rad).

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [April 6, 2026, 11:34pm UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/9 "2026-04-06T23:34:24Z")

</div>

Then it seems you have that sorted! If you’re coding in blocks, I’d also suggest publishing the game to a link to playtest it (so the block code part isn’t open), deleting extra gray blocks floating around, and deleting any unused extensions.

---

<div class="post-metadata">

**Author:** ![Kee](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@Kee](https://forum.makecode.com/u/Kee)\
**Post date:** [April 8, 2026, 1:39am UTC](https://forum.makecode.com/t/how-do-i-optimize-games-on-makecode-arcade/42179/10 "2026-04-08T01:39:23Z")

</div>

I don’t program in blocks anymore. I switched to JavaScript back in 2024 since it got way too laggy.
