The problem is. I run my game at:
//Width, Height
public static int HEIGHT = 1080;
public static int WIDTH = HEIGHT * 14 / 10;
Width: 1512 , Height: 1080 (14:10)
screen = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
Then I create a Buffered Image for INT_RBG. The size of the buffered image is put in as (WIDTH, HEIGHT) So the Buffered Image is the size of the screen.
Graphics2D gr = (Graphics2D) bs.getDrawGraphics();
Graphics2D Gscreen = screen.createGraphics();
I draw all my objects to my screen (Buffered Image) (GScreen) then I use gr to draw that image. And show my buffer
gr.drawImage(screen, 0, 0, WIDTH, HEIGHT, null);
gr.dispose();
bs.show();
frame.pack();
At the default resoultion (1512, 1080) it works fine. The missiles shoot and it resizes and works perfectly. Now we use my re-size method to put it down to 366, 240 which is still in the 14:10 ratio.
public void setSize(int SIZE) {
HEIGHT = SIZE;
WIDTH = HEIGHT * 14 / 10;
frame.setSize(WIDTH, HEIGHT);
}
It re-sizes perfectly and looks good. But when I shoot my missile. It ends around a quarter of the way across the screen.
Now the way I set it is if a missile's X travels over Game.WIDTH then Visible = false and to remove the bullet from the array.
**Bullet.class**
if (x > Game.WIDTH) {
visible = false;
}
**Game.class**
for (int w = 0; w < bullets.size(); w++)
{
Bullet m = (Bullet) bullets.get(w);
if (m.getVisible() == true) {
m.move();
} else {
bullets.remove(w);
}
}
I'm quite stuck. Ask any questions or if you need any-code I can help. In-case you forgot.forgot. I'm tring to make the bullets go to the end of the screen then fire the remove method at a resolution change at the correct time.
I don't know if its logic's or graphics fault aswell.
Extra Code Snippets
Game.class, Render This renders the bullets:
for (int i = 0; i < bullets.size(); i++) {
Bullet m = (Bullet) bullets.get(i);
Gscreen.drawImage(im.stoneTile, m.x, m.y, 40 , 40, null);
}
Thanks for your time.