# Next level if reach score X before countdown clock ends

**URL:** <https://forum.makecode.com/t/next-level-if-reach-score-x-before-countdown-clock-ends/17866>\
**Category:** Help\
**Created:** [February 7, 2023, 6:23pm UTC](https://forum.makecode.com/t/next-level-if-reach-score-x-before-countdown-clock-ends/17866 "2023-02-07T18:23:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BruceSchwa](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@BruceSchwa](https://forum.makecode.com/u/BruceSchwa)\
**Post date:** [February 7, 2023, 6:23pm UTC](https://forum.makecode.com/t/next-level-if-reach-score-x-before-countdown-clock-ends/17866/1 "2023-02-07T18:23:24Z")

</div>

May I ask someone to show me the code for:

1. level to change
2. when score reaches X before countdown clock ends

Thanks!

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [February 7, 2023, 7:30pm UTC](https://forum.makecode.com/t/next-level-if-reach-score-x-before-countdown-clock-ends/17866/2 "2023-02-07T19:30:50Z")

</div>

Can you provide some kind of base code? Like sharing your game or template.

---

<div class="post-metadata">

**Author:** ![BruceSchwa](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@BruceSchwa](https://forum.makecode.com/u/BruceSchwa)\
**Post date:** [February 9, 2023, 12:42am UTC](https://forum.makecode.com/t/next-level-if-reach-score-x-before-countdown-clock-ends/17866/3 "2023-02-09T00:42:39Z")

</div>

Here you go [https://arcade.makecode.com/S40650-90688-89723-23608](https://arcade.makecode.com/S40650-90688-89723-23608)

---

<div class="post-metadata">

**Author:** ![iHasGoodName](https://avatars.discourse-cdn.com/v4/letter/i/ecd19e/32.png) [@iHasGoodName](https://forum.makecode.com/u/iHasGoodName)\
**Post date:** [February 10, 2023, 5:48pm UTC](https://forum.makecode.com/t/next-level-if-reach-score-x-before-countdown-clock-ends/17866/4 "2023-02-10T17:48:18Z")

</div>

I believe you can set it so that when score equals 50, change current Level by one, call new level, and restart the countdown. You could also put the countdown you want for the individual level inside the function if you want different times. You may also need a clear level function which is just deleting all the sprites so that when the new level is called there isn’t extra sprites.
