# Trying to optimize game :c

**URL:** <https://forum.makecode.com/t/trying-to-optimize-game-c/45810>\
**Category:** Arcade\
**Tags:** game\
**Created:** [September 9, 2026, 5:31pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810 "2026-09-09T17:31:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![2cool4u](https://avatars.discourse-cdn.com/v4/letter/2/ea5d25/32.png) [@2cool4u](https://forum.makecode.com/u/2cool4u)\
**Post date:** [September 9, 2026, 5:31pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/1 "2026-09-09T17:31:57Z")

</div>

Basically, I have no idea how to optimize my code without breaking it, for some reason there are random lag spikes, happened ever since i added background music. I’ve cut down on code that runs on game updates yet nothing changes. pls help any1 😢

A to skip cutscene

hold a for gun

b for missile

a+b to flare for IR missiles (does not work mobile rn)

wasd to control (suggest using arrow keys)

> **[Game of main](https://arcade.makecode.com/S71640-88852-02408-10482)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [September 9, 2026, 5:36pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/2 "2026-09-09T17:36:54Z")

</div>

@2cool4u it’s because you’re pausing inside of “on game update”

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/0/50e78c9e020b0afe5850e7c1fdc95772a546c14b.png)

all the code in on game update needs to run each frame before the game is drawn to the screen. if you pause, it will freeze your game on that frame until the pause completes.

the fix here is to either put those repeat blocks into a “separately do” block from the timers extension, or use a forever block instead of an “on game update”

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 9, 2026, 10:42pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/4 "2026-09-09T22:42:59Z")

</div>

How can authors delete posts?! i havent seen anything like that for me…

---

<div class="post-metadata">

**Author:** ![Sword\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sword_studios/32/35216_2.png) [@Sword\_Studios](https://forum.makecode.com/u/Sword_Studios)\
**Post date:** [September 9, 2026, 10:46pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/5 "2026-09-09T22:46:49Z")

</div>

Maybey because youre a new user? I actually dont know if the trash icon appears for new users

---

<div class="post-metadata">

**Author:** ![TheEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theearth/32/34579_2.png) [@TheEarth](https://forum.makecode.com/u/TheEarth)\
**Post date:** [September 10, 2026, 3:35am UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/6 "2026-09-10T03:35:01Z")

</div>

Click the dot dot dot on one of ur post and their should be a trash coin click on it and the post gets deleted

---

<div class="post-metadata">

**Author:** ![kirbob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kirbob/32/34880_2.png) [@kirbob](https://forum.makecode.com/u/kirbob)\
**Post date:** [September 10, 2026, 3:37am UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/7 "2026-09-10T03:37:48Z")

</div>

press teh 3 dots on a post then click delete.

---

<div class="post-metadata">

**Author:** ![2cool4u](https://avatars.discourse-cdn.com/v4/letter/2/ea5d25/32.png) [@2cool4u](https://forum.makecode.com/u/2cool4u)\
**Post date:** [September 10, 2026, 4:44pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/8 "2026-09-10T16:44:34Z")

</div>

Thank you so much! I’m using a separately do block now from timers extention!

---

<div class="post-metadata">

**Author:** ![ShadowWhisker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shadowwhisker/32/35148_2.png) [@ShadowWhisker](https://forum.makecode.com/u/ShadowWhisker)\
**Post date:** [September 10, 2026, 4:48pm UTC](https://forum.makecode.com/t/trying-to-optimize-game-c/45810/9 "2026-09-10T16:48:31Z")

</div>

Ohhhhh thanks
