Merge remote-tracking branch 'origin/master'

master
bob 2022-06-03 13:17:27 -04:00
commit bcd896ed45
3 changed files with 5 additions and 1 deletions

BIN
img/misc/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -34,6 +34,10 @@ public class GameFrame extends JFrame{
}
this.add(game);
this.setTitle("GUI is cool!"); //set title for frame
// set game icon and ignore exception (failing to set icon doesn't otherwise break program)
try {
this.setIconImage(GamePanel.getImage("img/misc/favicon.png"));
} catch (IOException ignored) {}
this.setResizable(false); //frame can't change size
this.setBackground(Color.white);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //X button will stop program execution

View File

@ -191,7 +191,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener{
return ImageIO.read(new File(imageLocation));
}
public BufferedImage flipImageHorizontally(BufferedImage originalImage) {
public static BufferedImage flipImageHorizontally(BufferedImage originalImage) {
BufferedImage flippedImage = new BufferedImage(originalImage.getWidth(), originalImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
for (int x = 0; x < originalImage.getWidth(); x++) {
for (int y = 0; y < originalImage.getHeight(); y++) {