I created a 2D light collision algorithm which generates a black and white image. I am then using this pixel data to modify a second overlay image, which starts full black. Each frame:
* If the light image pixel is white, set the "same" overlay pixel to transparent
* If the light image pixel is black, but the "same" overlay pixel is transparent, set it to "dim"
This only works
on the first frame.
After pulling my hair out for a while, I
think there's an underlying problem with processing... or I have completely missed something. What I'm seeing is this: the pixel array of the light image never updates after the first frame, even though the image is being constantly updated.
I created a simplified program to demonstrate this. The "light" is just an arc that rotates. The overlay is just trying to copy the light's pixels one to one each frame. You can uncomment image(light, 0, 0) to see that the light is updating correctly. But other than that... ???
First of all,
thank you for implementing Generics in Processing 1.2.1.
Seriously! Huge.
Anyways, my little pet project is a roguelike being written in Processing. I'm trying to leverage my knowledge as an experienced game designer with "best of" code ideas to create a strong, extensible foundation.
One of those "best of" ideas appears to be Entity Component Systems (or Entity Systems, or Component Oriented Programming (COP), or... etc.). I've gone deep with my sketches before, but this is the deepest. I am not a Java programmer by trade. =)
For more information on Entity Component stuff, here are some useful links:
And, finally, here is my "version 1" for you all to dissect and critique... please! I hope to either learn something, or spark the desire to learn in someone else.