top of page

LEVEL SELECTION!! Part 2

Writer's picture: Dabrina♡Dabrina♡

Hello! Today I am going to discuss a little bit about the level selection screen I am currently coding. So, earlier in my blogs, I mentioned before that I wanted a Mario-style level selection screen where the character walks to the next level when you select it. However, I have somewhat modified that idea because I currently have other things I need to focus on.


So I have set up a level selection where the character object can move to the different levels. This is done using an array, so the player iterates through the elements in the array, which in this case are the different levels. The player is moved using the left and right keys, but to actually enter a level the player must press on the level.


I have changed the purpose of lucidity in the game and it actually relates to the levels. To get to the boss and the next level the player must have enough lucidity. If they do not have enough they can't get to the next level and must go back and search the previous level to find all the lucidity they missed.


The functionality of the level selection script was working well originally, but I later realised that the player object disappears when the arrow keys are pressed. I checked to see in the editor if it was due to the layers (2D games have different layers meaning that the player could have been covered by something), but it seemed that the player had completely disappeared. I added in a Debug.Log to make sure the player object was iterating through the elements of the array (the levels) and it was. How I fixed it was by having the player's position be altered outside of the PlayLevel() function which is used for calling the different scenes and updating the level index. Instead, the player's position was changed in the MoveSelection() function which increases the current index. With that change,

I am now able to see the player's object as it moves through the scene.


The level selection is now working and is ready for all the levels and assets to make it look cool!

That's all,

Dabrina

2 views0 comments

Recent Posts

See All

Comments


bottom of page