# Level Help, need someone

**URL:** <https://forum.makecode.com/t/level-help-need-someone/4132>\
**Category:** Help\
**Created:** [October 28, 2020, 6:01pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132 "2020-10-28T18:01:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 28, 2020, 6:01pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/1 "2020-10-28T18:01:30Z")

</div>

Hello all,

I am working on this project and I saw an example of one just like it. I need someone to make this block code to where there are levels. If you do it I will ensure that you are credited and recommend you to others, thanks! 😃

> **[Air Strike](https://arcade.makecode.com/97185-52583-96056-98597)**
>
> 用❤️创造，Microsoft MakeCode Arcade出品。

---

<div class="post-metadata">

**Author:** ![FlintAsher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/flintasher/32/2745_2.png) [@FlintAsher](https://forum.makecode.com/u/FlintAsher)\
**Post date:** [October 28, 2020, 7:17pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/2 "2020-10-28T19:17:22Z")

</div>

Make something like this and fit it to your game. Make a variable called ‘current level’ set it to zero on start, then set it to change by one once you reach the end of the level. The create a function called ‘startLevel’ and add the if statement grid you see below.  
 ![Screenshot 2020-10-28 at 12.14.00 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/08279865cc1aa936cec59a2ffee2ab3f219cba43.png)  
The game over at the end will make it so that once you beat the final level you’ll actually win the game. Also ignore the status bar part if you’re not using the status bar extention.

I hope you find this useful.

---

<div class="post-metadata">

**Author:** ![FlintAsher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/flintasher/32/2745_2.png) [@FlintAsher](https://forum.makecode.com/u/FlintAsher)\
**Post date:** [October 28, 2020, 7:23pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/3 "2020-10-28T19:23:33Z")

</div>

Also i absolutely love your amazing art in game. Also since your game is a shooter, you can make it ‘on game update’ once the player reaches a certain score call ‘startLevel’ and change level by one.

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 28, 2020, 8:52pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/4 "2020-10-28T20:52:53Z")

</div>

thank you! love the community here.

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 28, 2020, 9:24pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/5 "2020-10-28T21:24:57Z")

</div>

I have some questions though, hopefully it doesn’t bother you, what block would I use to set the current level to zero, and what do you have in the tilemap that I should put, I can’t see it that well.

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 29, 2020, 3:51am UTC](https://forum.makecode.com/t/level-help-need-someone/4132/6 "2020-10-29T03:51:18Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/52a59b67b39ed2747431a9c50716ab2d5c335fad.png) this is what I got going, idk what im doing

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 29, 2020, 3:54am UTC](https://forum.makecode.com/t/level-help-need-someone/4132/7 "2020-10-29T03:54:48Z")

</div>

im trying to figure out when the player reaches a certain score i call startlevel function and change it by 1 because now, anytime when the player presses any button and releases it, it shows the win sign.

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 29, 2020, 4:08am UTC](https://forum.makecode.com/t/level-help-need-someone/4132/8 "2020-10-29T04:08:40Z")

</div>

yay it worked, when I added math to a if statement on a game update and called the function “startLevel” and then changed the current level to 1, when it reaches 250, it wins the game, i want it to switch levels instead.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/230d3cd50c8163ed057989979f9a3c0fcab99964.png)

---

<div class="post-metadata">

**Author:** ![FlintAsher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/flintasher/32/2745_2.png) [@FlintAsher](https://forum.makecode.com/u/FlintAsher)\
**Post date:** [October 29, 2020, 3:08pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/9 "2020-10-29T15:08:17Z")

</div>

So what i think you can do is you can set it to when it reaches 250 you change levels and then to reach the next level you need to reach 500 or something like that. I honestly don’t know how to do that since i’ve never used a score count to tell when to change levels. Since your game has enemies coming down from the top, what i have in the tilemap isn’t that important, what you could probably do though is to change the background a bit and splash some text saying ‘Level 2 Start’ or something along those lines. If you need more help on the whole level changing thing there are tutorials on Makecode Arcade youtube channel that could help you with that.

---

<div class="post-metadata">

**Author:** ![timber](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@timber](https://forum.makecode.com/u/timber)\
**Post date:** [October 29, 2020, 4:21pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/10 "2020-10-29T16:21:29Z")

</div>

I think the issue that since your score is equal to 250 for a prolonged period of time it keeps changing your level by 1 until you get to the else condition in your startLevel function.

A simple fix would just be resetting the score at each level or adding some bonus points for completing a level to get you below or above your level switch point condition.

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 29, 2020, 9:42pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/11 "2020-10-29T21:42:21Z")

</div>

absolutely will try the splash text instead of tile map cause afterall it isnt a platformer

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 29, 2020, 9:53pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/12 "2020-10-29T21:53:53Z")

</div>

yes, that was another problem i ran into. Since it is equal to 250 it will change by 1. if you go above 250 it will do nothing. i actually colored the tiles on the if sequence different colors to see the change in levels and it went past all of the levels automatically which isnt want I want, thanks for the fix. Ill get back to you once im done.

---

<div class="post-metadata">

**Author:** ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)\
**Post date:** [October 29, 2020, 9:59pm UTC](https://forum.makecode.com/t/level-help-need-someone/4132/13 "2020-10-29T21:59:57Z")

</div>

@FlintAsher and @timber. There really was no reset score so I “set score to 0.” Brilliant. I also added text to signify the change in levels. I want to thank the both of you! I might have other questions later. 😉
