Adding Levels

We can easily add multiple levels to our Arcade game by following the below steps:

  • Create a new variable to store the current level.
self.level = 1
  • Load the sprites you are going to use in the current level with the help of self.level variable. For this example, we are going to load ‘Platform1’ named sprites for level 1, ‘Platform2’ named sprite for level 2, and so on.  For this, we can load the platforms using the below code.
platform = arcade.Sprite(f"Platform{self.level}.png", 1)
  • If the player crosses the right side of the screen then we are going to increase the value of self.level variable to go to the next level.
 if self.player_sprite.center_x>690:
    self.level += 1

Python Arcade – Adding Levels

In this article, we will learn how to add different levels to our arcade games in Python.

Similar Reads

Adding Levels

We can easily add multiple levels to our Arcade game by following the below steps:...

Functions Used:

Camera(): The Camera class is used for controlling the visible viewport....