Score: 0
Use Arrow Keys to Move
// If Pac-Man's x is greater, Pac-Man is to the right. if (pacman.x > ghost.x) dx = ghost.speed; // Move right // If Pac-Man's x is less, Pac-Man is to the left. else if (pacman.x < ghost.x) dx = -ghost.speed; // Move left // If Pac-Man's y is greater, Pac-Man is below. if (pacman.y > ghost.y) dy = ghost.speed; // Move down // If Pac-Man's y is less, Pac-Man is above. else if (pacman.y < ghost.y) dy = -ghost.speed; // Move up