Skip to content
Sign upLog in

Deleting a Block

Profile icon

So I am creating a game in pygame
I was wondering how to delete the block in class Level_01.


You are viewing a single comment. View All
Profile icon

What I did changed is: I make from the class Level_01 and Level_02 the levels to put into a level array called "level_list". Then i took the current level the get the level you're playing in. That is also the level from the player so you get player.level = level_list[current_level_no]. A few lines of code need this to (level_list[current_level_no]). Then the 'try' and 'except' block. This is to get no errors when the list index of 'level_list' is out of range. The program then stops.