updated renderPacman function