Testing some pixel effect (lights simulating palette shift pixel by pixel) I’ve faced some strange behavior.
This is a test code that should point out the problem:
for(int y=10;y<60;y+=1){
int c=0;
for(int x=10;x<60;x+=1){
//take the color of the pixel before
c=game.display.getPixel(x,y);//<< toggle this line to see the difference
//next color
c=(c+1)%16;
//draw it
game.display.drawPixel(x+1,y,c);
}
}
Basically here I’m taking the color of the pixel in the row, and then use the next color to draw the next pixel. So I’m expecting something like this:
Again, a new release of the lib that opens up this stuff is coming by Sunday. Then you can easily solve this kind of things also. Just wait a little bit
Finally I’ve some time to spent on this issue. Thanks @jonne you really point me on the right direction, it was an easy fix with your suggestion. Just made a small PR to your repo.
Now I can experiment more with my poor texture light system: