# Changing levels with functions

**URL:** <https://forum.makecode.com/t/changing-levels-with-functions/41838>\
**Category:** Help\
**Created:** [February 1, 2026, 10:01pm UTC](https://forum.makecode.com/t/changing-levels-with-functions/41838 "2026-02-01T22:01:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElPanzerIII](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/elpanzeriii/32/28564_2.png) [@ElPanzerIII](https://forum.makecode.com/u/ElPanzerIII)\
**Post date:** [February 1, 2026, 10:01pm UTC](https://forum.makecode.com/t/changing-levels-with-functions/41838/1 "2026-02-01T22:01:01Z")

</div>

So, i’m trying to make a game with a title screen as level 0, and when you press A it goes to the menu (level 1).  
I made a function that changes what’s in each stage. But when i press A it doesn’t work.  
I don’t know if it’s a variable problem or the functions are not functioning well. I need help.  
link: [https://arcade.makecode.com/S87801-60279-45355-14992](https://arcade.makecode.com/S87801-60279-45355-14992)

---

<div class="post-metadata">

**Author:** ![dogSquid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dogsquid/32/26689_2.png) [@dogSquid](https://forum.makecode.com/u/dogSquid)\
**Post date:** [February 1, 2026, 11:52pm UTC](https://forum.makecode.com/t/changing-levels-with-functions/41838/2 "2026-02-01T23:52:48Z")

</div>

> **[2500](https://arcade.makecode.com/65932-56209-02889-47862)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Is this what you were looking for?

---

<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:** [February 2, 2026, 12:01am UTC](https://forum.makecode.com/t/changing-levels-with-functions/41838/3 "2026-02-02T00:01:07Z")

</div>

![Pause until over if](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/9/29be94a03c319d3437927da619bb1d4325dd176d.png)

---

<div class="post-metadata">

**Author:** ![ElPanzerIII](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/elpanzeriii/32/28564_2.png) [@ElPanzerIII](https://forum.makecode.com/u/ElPanzerIII)\
**Post date:** [February 2, 2026, 4:00am UTC](https://forum.makecode.com/t/changing-levels-with-functions/41838/4 "2026-02-02T04:00:38Z")

</div>

oh thank you, i don’t even know how i got stuck there

---

<div class="post-metadata">

**Author:** ![OrigamiArtist](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/origamiartist/32/33299_2.png) [@OrigamiArtist](https://forum.makecode.com/u/OrigamiArtist)\
**Post date:** [February 2, 2026, 11:45pm UTC](https://forum.makecode.com/t/changing-levels-with-functions/41838/5 "2026-02-02T23:45:04Z")

</div>

Maybe you could try using the if true else if false block instead of two if true blocks?
