FlixelCommunity / flixel

Community fork of Adam “Atomic” Saltsman's popular game engine Flixel. Distilled from a variety of Flash games he worked on over the last couple years, including Gravity Hook, Fathom and Canabalt, its primary function is to provide some useful base classes that you can extend to make your own game objects.
http://flixelcommunity.org/
Other
84 stars 17 forks source link

Add ray casting with soft shadows #198

Open Dovyski opened 10 years ago

Dovyski commented 10 years ago

I got this idea while seeing this amazing demo by @yadurajiv (Github repo here). It's an AS3 implementation of ray casting using soft shadows.

It would be outstanding to have something like that in Flixel, as a plugin or a core feature.

IQAndreas commented 10 years ago

I can't remember if I saw this in Flixel or somewhere else, but does Flixel already have some sort of ray-casting code in the tilemaps?

yadurajiv commented 10 years ago

There was a game that had lasers and a ninja, I can't remember, he had released some Ray tracing code which worked with flixel tile maps. I made it look like shadows and stuff, hope to share that as soon as I get home -_- On 02-Dec-2013 6:46 PM, "Andreas Renberg" notifications@github.com wrote:

I can't remember if I saw this in Flixel or somewhere else, but does Flixel already have some sort of ray-casting code in the tilemaps?

— Reply to this email directly or view it on GitHubhttps://github.com/FlixelCommunity/flixel/issues/198#issuecomment-29616520 .

WingEraser commented 10 years ago

Bullet Time Ninja

SeiferTim commented 10 years ago

http://space.madsoftgames.com/ - I'd be happy to share the code for the lighting effect, although, I don't know how easy it would be to make it work better in Flixel...

yadurajiv commented 10 years ago

Yush! BTN had a ray tracer that worked with tilemaps! You can do stuff like this. :)

Dovyski commented 10 years ago

Thank you all for the contribution, guys! It seems this is a nice feature to add :)

I can't remember if I saw this in Flixel or somewhere else, but does Flixel already have some sort of ray-casting code in the tilemaps?

Yeah, it has, it's FlxTilemap::ray() (here's the function definition). It could be used to create the feature I suggested if we build on top of it.

@SeiferTim Thanks! Your game is really cool! :D The lighting effect is amazing, it's exactly what I had in mind when suggested this feature. If you are ok about sharing the code, we could try to make it work with Flixel (maybe combining it with @yadurajiv 's tilemap ray tracer).