Like all good philosophical questions, the answer is, "Yes and no." Or, in this case, "No and yes."  

On the one hand, G‑d Himself testifies in the Torah: "I am G‑d, I have not changed" (Malachi 3:6). Meaning, Creation in no way alters or affects G‑d. The book of Job (35:6) expresses it thus: "If you sin, how have you affected Him? If your transgressions multiply, what do you do to Him? If you are righteous, what do you give Him? What can He possibly receive from your hand?" In plain English, it doesn't matter to G‑d what we do — we have no effect on Him.

On the other hand, we see that G‑d created a physical world, and gave His preeminent creation, man, a Torahful of rules and regulations. These commandments, called mitzvot, include all types of rituals and legislate all ethical and moral areas of life. It seems then that it matters very much to G‑d what we do. After all, if a world full of people means nothing to G‑d, then why did He create one?

Both premises are correct. G‑d didn't need a world which would ultimately be perfected by man, but He wanted one. So G‑d is affected by what we do, but only because He wants to be affected. Which means that He's really not affected. But on a deeper level, it means that He really is affected, because He chose to, and His choosing to makes it real.

Chassidic teaching illustrates this idea with the following metaphor: A father is playing with his two-year-old child. If the child fails at the game, the father becomes all sad; his face crumbles and he emits sobbing sounds. When the child succeeds, the father is happy: he smiles, whoops with joy and leaps excitedly into the air.

Does the father really care about whether a little piece of plastic is placed on the right or wrong square on the game board? No and yes. The act, in and of itself, means nothing to him. But he wants to interact with his child — i.e., he wants his child to affect and be affected by him. So he creates this game in which the players are challenged to achieve certain results — in which there are right moves and wrong moves, successes and failures. And for the game to work, the father makes himself care about the results (a mere mechanical involvement would make it meaningless to the child, too). He invests himself in the game, in effect "condensing" (a process which the Kabbalists call tzimtzum) his adult self so that it resides within the parameters of the child's world.

So when the father frowns or cheers, it's real. He's not "faking" it. He really does care — not because he really cares but because he really wants to care.

As the Chassidic masters are quick to point out, however, the metaphor of the father playing with the child does not truly parallel G‑d's relationship with us. Understanding this metaphor moves us a tiny bit closer to understanding what's going on between G‑d and His creation, but beyond that, the analogy breaks down. Because the father in the metaphor is a being who cares, who is affected by things — just like his child. The difference between them is only a matter of degree. The child cares about a candy; the father is beyond caring about candies — he cares about important things, like a $20,000 raise. So the father's tzimtzum entails only a "condensation" of degree, not of essence. G‑d, on the other hand is Ultimate Being — infinite, perfect, complete. He needs nothing. Making Himself care is a not a "condensation" from big to small but from infinite to the finite — for which, of course, there is no analogy in our experience. Nevertheless, the father/child metaphor introduces us to the idea of "elected caring", bringing us a minuscule step closer to appreciating that G‑d, despite being above it all, has imparted true significance to our existence and our actions.