# My game is lagging alot and I'm not sure how to fix it

**URL:** <https://forum.makecode.com/t/my-game-is-lagging-alot-and-im-not-sure-how-to-fix-it/40267>\
**Category:** Help\
**Tags:** game\
**Created:** [November 7, 2025, 5:15am UTC](https://forum.makecode.com/t/my-game-is-lagging-alot-and-im-not-sure-how-to-fix-it/40267 "2025-11-07T05:15:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nia\_nair](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nia\_nair](https://forum.makecode.com/u/nia_nair)\
**Post date:** [November 7, 2025, 5:15am UTC](https://forum.makecode.com/t/my-game-is-lagging-alot-and-im-not-sure-how-to-fix-it/40267/1 "2025-11-07T05:15:28Z")

</div>

> **[COOKED actual](https://arcade.makecode.com/S01096-23801-92170-80230)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<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:** [November 8, 2025, 6:11pm UTC](https://forum.makecode.com/t/my-game-is-lagging-alot-and-im-not-sure-how-to-fix-it/40267/2 "2025-11-08T18:11:06Z")

</div>

I’m guessing its the overlap blocks that are causing the lag!  
For example, this code is meant to cause hearts when you touch a green tile and make the player speak when they touch an enemy:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/c/9c1b383e6faf23ca337fde63d9dba0d0f584bb5c.png)  
However, this code will actually run for every frame (fraction of a second) that the player is overlapping either of these things.  
So, each of these blocks could run THOUSANDS of times before the player gets out of the way, causing a lot of lag!  
I’d suggest using a cooldown like this so the same overlap can’t happen too often:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/0/d02faf150d18688cfcf8a94ad02c5d09daa8b16c.png)  
[Here’s the link](https://arcade.makecode.com/S10972-40210-39540-50481), and let me know if there’s another way the game is lagging that I missed!  
Also, I love the art and story in this game!! The opening really got me invested in the story and the characters are so cute 😆
