Hi there,
I’m trying to write a 4k contest entry and I’m a bit stuck. I’ve not done any Java2d stuff before.
I have an int[][] which contains a list of colour indexes e.g. 0 is transparent, 1 is black 2 is white etc. and I have a sprite setup in this format of size 16x16.
Now as the player turns I want to rotate this sprite around a given point. I’m currently drawing my sprite using a two for loops (inner and outer) and a drawPixel method I wrote.
How do I go about performing these rotations, do I need to create a temp image or similar, or do I need to write some form of Bhremsian line algorithm?
I have a BufferStrategy setup already to make things nice and smooth, any pointers would be appreciated.
Thanks,
Andy.
PS: Reading a bit more Javadoc, I’ll now ask the question, do I need to somehow use an AffineTransform to solve this?