Deviation Actions

ssjskipp's avatar

Shadows and Lights

By ssjskipp
WASD to move one light source, Arrow keys to move the other.

So, after a weekend of working, I've made a sort of shadow & light engine for my top down shooter game.

It has support for up to 256 on screen shadows (it can really go up to 65535, but that'd be weird). It can use a lot of optimization, and there are a few obvious glitches to hammer out.

I had a MUCH nicer version with only 1 light, but I feel two lights make it much...cooler :3


By the by, the map is made up of rectangles (I can place as many as I like), I haven't added circles with shadows, but they wouldn't be that hard. I could really add convex n-gon shadows, but I'm lazy. So sue me.

For now, this is completely mine, and I won't be giving out the source (but I will say the method if you're curious). I need the script for future games.
Image details
Image size
550x400px 24.91 KB
Join the community to add your comment. Already a deviant? Log In
wonderwhy-ER's avatar
Looks promising but kind of resource intensive no?
ssjskipp's avatar
There's a lot of room for optimization. Right now, the only problem I'm having is with the bitmap half (the vector half is spot on).
For me, it runs at a perfect 30 FPS... In the new one I'm working on I'll toss in an FPS meter, so we can see for sure.
wonderwhy-ER's avatar
Well it is not only about FPS, how much room you have left for other stuff like throwing in more graphics, collisions etc, for me it seemed to eat up 50% of CPU but visually being normal. But how much room for more is left there.
ssjskipp's avatar
This is very true -- I need to come up with a good way to render multiple light sources and their shadows. And I think I have a few ideas...
wonderwhy-ER's avatar
Good luck with that, so far looks impressive :)
secv's avatar
Wow, that's pretty interesting! I'm curious as to what this game is going to be...
littlegoblet's avatar
very clever buddy you must be very familiar with action script.
Join the community to add your comment. Already a deviant? Log In