Making a brick breaker in OOP

Can someone pls help me making my homework which is to do a brick breaker game in class (POO) in python. I have to do multiple levels and I cannot figure how to do that.
This is what I have already done:
For the game itself : # FONTCION DE BASE from paddle import Paddle #import de la classe Paddle -
For the ball, the paddle and the brick : # coding=utf-8# OBJET BRICKclass Brick(): #attribut de classe un dic -

1 Like

I think that’s OOP (object oriented programming)


1 Like

Welcome @Antoine

Best to move this question to the category.

Perhaps a structure like this might work?

levels_data = [
  ['blue', 'green', 'orange'],  # level 0
  ['pink', 'green', 'red'],     # level 1
  ['red', 'red', 'blue'],       # level 2

level_number = 0

def setup():
    size(600, 400)
    for brick in levels_data[level_number]:
        print(brick)  # render the bricks for the level
def draw():
    # all of your game logic ...

def keyPressed():
    # advance a level (using a key-press for this example)
    global level_number
    level_number += 1

Yes, sorry because I am french and in french is Programmation Orienté object.

1 Like

I’ll tomorrow and I’ll tell u. Thanks
If u are available to voc and try to improve my program this will be so goood.