Dynamic Lighting, huge performance issuses


(Abel Toy) #21

To do it I adapted the code from this tutorial: http://dev.tutsplus.com/tutorials/building-a-dynamic-shadow-casting-engine-in-as3-active-premium--active-8317

I ported it to bitmaps, optimised it a lot, removed the blur and optimised it again. So, the concept of how it works is the same, but the implementation is completely different. I’ll try to find if I still have the source if someone’s interested.


(azrafe7) #22

Nice! Sure I’d like to take a look at the code. Mind to share it if you recollect it?

PS: Are you using some tween to smooth the flashlight movement?


(Jacob Albano) #23

The turning might be done with an approach like this.


(Abel Toy) #24

Yeah, the flashlight movement was done using an approach.

Here’s the source code. There’s some unfinished stuff (like an editor). I planned to release a full game using this code, and maybe I’ll still do at some point, but you guys can have a look if you want!

Horror Arena - AS3.zip(1.2 MB)

(why is zip allowed but rar isn’t?)