improved function renderPacMan. Now it paints an object to fit into its bounding box