For a first game, this is excellent good job.
I'm assuming that the way the moon moves is it continually sets the transform to the mouse position? If so, then you could patch the collision bugs by using a Rigidbody2D, and setting its velocity to be the moons position subtracted by the player's position. The main issue with modifying the Transform on it's own is that it doesn't check for collisions, and just sort of teleports you, which has a tendency to cause clipping problems.
Either way, welcome to the world of game dev.