I hope you can help me with this one. I remember watching it when I was a kid in the 80's but I don't know when it was made.
I only remember parts of it and these are the scenes that come to mind.
*an evil wizard builds his castle out of human-shaped blocks that march toward the castle in a line and fit themselves into place almost like an Escher painting.
*the wizard is perfectly spherical (possibly red)
*the child hero of the movie defeats the wizard at the very end by cutting him or stabbing him with something, but then ends up making him feel better by telling him that he would like to be his friend. (The castle is crumbling around them)
If anyone remembers this movie I'd really appreciate it!