platformer shadows

Looking for advice on how to do shadows. I’m building a platformer and I want my character to have a shadow. The shadow itself is easy to make and track with the character, but any suggestions on how I might hide/show the shadow between platforms as the character jumps? I figured I can mask the shadow somehow, but getting the mask to line up with the edges of each platform, which are sized differently, seems tricky. 

Anyone ever tried this or have thoughts on how to accomplish it? 

Can you simply hide the shadow when you trigger an event for your character? This is very pseudo code, but it’s the logic I would use.

function jump()    -- Jumping code    player.shadow.isVisible = false end

Then call player.shadow.isVisible = true when he lands again?

Have the shadow as a separate graphic, but it in a group with the original one, and as 44D says above, make it invisible in jumping.

The only way you are going to get a realistic shadow is by doing the thing in 3D ; you can probably settle for near enough. It’s great to make it as nice as possible, but it’s more important to get the game right. Prettiness might get more people trying your game, but playability will keep them there.

Can you simply hide the shadow when you trigger an event for your character? This is very pseudo code, but it’s the logic I would use.

function jump()    -- Jumping code    player.shadow.isVisible = false end

Then call player.shadow.isVisible = true when he lands again?

Have the shadow as a separate graphic, but it in a group with the original one, and as 44D says above, make it invisible in jumping.

The only way you are going to get a realistic shadow is by doing the thing in 3D ; you can probably settle for near enough. It’s great to make it as nice as possible, but it’s more important to get the game right. Prettiness might get more people trying your game, but playability will keep them there.