The figure of speech used in the example provided is METAPHOR.
In literature, a metaphor is a figure of speech in which there is a hidden comparison between two unrelated things. For example, "I am a tiger" (figurative language).
In this case, the speaker compares himself with the shadow.