Basic function for Pacman