Question from my kid: Created a game but can't move to next level properly

My kid is very keen on working more on it at home. She designs a game with level 1, 2 and 3.

She finished one level but it can’t move on to next level. Two situations might occur, either it shows error

or after level 1 jump directly to level 3. Here is her coding and she is very eager to hear your expertise to solve the coding question

Grateful if you can give her some clue and it can definitely encourage her to move forward to her game design.

1 Like

Hi there!

First thing is that Level 1 and Level 2 share the same tilemaps. An easy fix for this is to delete the level 2 tilemap block and replace it with a new tilemap block. Then go to assets and click the correct level 2 tilemap.

Second thing is that while you included a place mySprite on top of random tile block for level 2, you didn’t include one for level 3. So, when the game spawns the level 2 tilemap, it places the character on the next level changing tiles. Observe the code in the Next Level function below:

I’ve also changed the jumping mechanic so it’s more reliable and faster, although you will have to tweak it with an if else statement to make the character jump only when she’s on the floor. Keep on coding!

I fixed the error problem, but the level skipping problem isn’t an actual bug. The first 2 tilemaps(levels) ended up being the same, which means that the ‘next level’ function loads the same tilemap.

1 Like