Player position based (dynamic) shadows

Get help using Construct 2

Post » Wed Jan 30, 2013 4:32 am

I have been playing around with different techniques on producing dynamic shadows. The first method I tried was the canvas plugin, which works amazingly, but seems lack in performance when you begin adding more elements and events.

I also read @Rory's way of using a shadow sprite pinned to a caster object and setting its angle opposite to that of the player. I implemented this along with changing the size of the shadow based on a instance variable I place on the player called "shadowRange". Using some lerp & *dt I can change the size depending on the range (position) of the player. This works, but lacks the true responsiveness based on the players position due to the static nature of the instance variable.

I imagine there is a way to "lerp" the players distance in relation to the shadows position to change it's size... If that makes sense.

I have mocked up a little demo of what I was able to accomplish.. Shadows

Any pointers would be greatly appreciated.

Thanks,
Chris

EDIT: I updated the file. I figured out how to do it, after realizing I answered my own question. With a little tweaking I think that could work out nicely as a way to produce dynamic looking shadows.

Will update as I work on it further.facecjf2013-01-30 05:13:04
Image Image Image
B
60
S
19
G
5
Posts: 325
Reputation: 7,369

Return to How do I....?

Who is online

Users browsing this forum: GUN, MrLOL64 and 14 guests