Create dynamic "shadow" effect for a platformer


I am working on an bird enemy for my platformer. The way I would like it to attack is as follows:

The bird will be above the player's screen view, and casting a shadow on the ground. Once the player lands on that shadow the bird will follow him/her around for a couple seconds before swooping down onto the final position of the shadow. I am having trouble determining the best way to go about making a shadow that will morph around the wall objects (like a shadow would).

I played around with creating an entire sprite for the shadow, but I found that that was not convincing because then parts of the shadow would be able to hang off of the ledge, which I obviously do not want.

What would you recommend I do for a situation like this?


You can draw part of a sprite with draw_sprite_part().
So what I would recommend is:
Find out which ground object(s) the shadow should be displayed on. Could be just one, in which case you draw the entire sprite.
If it's 2 ground objects, draw the shadow in 2 parts, one on each object.