def DefineBalls(self, Tabla): self.removeBalls() width = 55 # width of the image + Space between height = 45 # height of the image + Space between for i in range(5): for j in range(4): #Tabla.PrintTorreDetallada() #print(i,j) color = Tabla.getColor(i, j) new_ball = Ball() new_ball.setColor(color) x_pos = self.getXStart() + (j * width) # i starts at 0 y_pos = self.getYStart() + (i * height) # i starts at 0 position = (x_pos, y_pos) new_ball.setPosition(position) self.addBall(new_ball)