Original Post
I have some Java Programming Experience so I bought "Developing Games in Java" book. Everything was going well until chapter 5, which I make a side scroller game. I downloaded the code from his website:
http://www.brackeen.com/javagamebook/
The main class file of chapter 5 is unable to import packages from other folders. I fixed this easly by moving the main class elsewhere to where it can easly find other packages and import them.
-Now it compile without errors!-
But when I try to run there file im pilled with errors:
Exception in thread "main" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster
at java.awt.GraphicsConfiguration.createCompatibleImage
at com.brackeen.javagamebook.tilegame.ResourceManager.getScaledImage
at com.brackeen.javagamebook.tilegame.ResourceManager.getMirrorImage
at com.brackeen.javagamebook.tilegame.ResourceManager.loadCreatureSprites
at com.brackeen.javagamebook.tilegame.ResourceManager. at com.brackeen.javagamebook.tilegame.GameManager.init
at com.brackeen.javagamebook.test.GameCore.run
I researched on the internet for a long time and found no one who came across any errors with any of the books source code. Any help at all? All the other book's source codes run fine execpt chapter 5. Maybe it's JCreator or a newer verson of Java.
http://www.brackeen.com/javagamebook/
The main class file of chapter 5 is unable to import packages from other folders. I fixed this easly by moving the main class elsewhere to where it can easly find other packages and import them.
-Now it compile without errors!-
But when I try to run there file im pilled with errors:
Exception in thread "main" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster
at java.awt.GraphicsConfiguration.createCompatibleImage
at com.brackeen.javagamebook.tilegame.ResourceManager.getScaledImage
at com.brackeen.javagamebook.tilegame.ResourceManager.getMirrorImage
at com.brackeen.javagamebook.tilegame.ResourceManager.loadCreatureSprites
at com.brackeen.javagamebook.tilegame.ResourceManager.
at com.brackeen.javagamebook.test.GameCore.run
I researched on the internet for a long time and found no one who came across any errors with any of the books source code. Any help at all? All the other book's source codes run fine execpt chapter 5. Maybe it's JCreator or a newer verson of Java.