function draws bars, ball, and background as colored rectangles