Adding levels in our Platformer game
Let's add levels in our Platformer game. We are going to add the levels in a single scene. For the change in difficulty of the level, we can increase the speed of the player that is running and we can specify a distance after which the level will be increased.
Now, before we dive into adding levels in the game, first of all, we should know the current level being played. Hence, we are going to add the Level label in the game scene, so that the user can know about the current level being played.
Adding the Level label
The Level label is a simple text that will be displayed on the game scene and will act as a bit of information to recognize the level which is being played. As discussed earlier, you can have the name of the level as a number, location, or description. A number, as a level identifier, is the most common etymology in games. In our Platformer game, we are using numbers as level labels.
Add the following code in the GameScene.swift
file. This code...