Javascript Pacman clone