As lighting and shadows in 2D scenes tend to be painted straight on the background, we may run into the issue that the background features areas of shadow or colored light. If our character walks from a brightly lit area into the said shadowed or colored light area but the lighting on the character doesn't change, it would look very much out of place. Changing the lighting of a character isn't something that we can easily solve using the static methods we explored in previous chapters.
We could fumble around with lots of lightmaps and custom logic for each part of the background, but that would soon get inconvenient. If we did this dynamically, based on the background or had local lights affecting the character's lighting, our job would be so much easier! Fortunately, we have two standard methods for this:
Ambient lighting
Edge (rim) lighting