Level Help, need someone

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! :smiley:

2 Likes

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
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.

1 Like

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.

1 Like

thank you! love the community here.

1 Like

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.

this is what I got going, idk what im doing

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.

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.

2 Likes

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.

1 Like

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.

2 Likes

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

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.

@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. :wink:

2 Likes