I am developing the logistics game "P1SIM" (see http://www.p1sim.org
) and I have a question about SLICK.
I would like to do something like this (pseudo code!):
this.png [ 2.47 KiB | Viewed 494 times ]
But there is no similar function. So how to modify the single pixels of an image?
I want to use loops to modify all pixels after each other and this way create an overview map of the terrain (see website for screenshots). Having modified the pixels I want to draw them using g.draw(image, x, y).
Thanks in advance for your help! I already coded more than 6000 lines of code, but now I get a bit stuck due to the pixel modification issue
//edit: i tried something like g.drawline(x, y, x, y) to draw pixels but drawing 400x400 pixels image that way really slows down the game
//edit: i am now using a buffer (see code). but its quite slow. how do you realize fast pixel modifications?
private ImageBuffer buffer;
private Image image;
buffer = new ImageBuffer(SIZE, SIZE);
image = buffer.getImage();
buffer.setRGBA(x, y, red, green, blue, 255);
- Economy/Logistics simulaton based on Java and Slick2D