Tried your code in Eclipse -- collision works fine. When I uncomment your image mask code I get the following exception:
Code:
Tue Jun 12 20:57:55 EDT 2012 ERROR:129000
java.lang.ArrayIndexOutOfBoundsException: 129000
at org.newdawn.slick.Image.getColor(Image.java:1248)
at javagame.Play.update(Play.java:114)
at org.newdawn.slick.state.StateBasedGame.update(StateBasedGame.java:268)
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:657)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)
at javagame.MyGame.main(MyGame.java:37)
Tue Jun 12 20:57:55 EDT 2012 ERROR:Game.update() failure - check the game code.
org.newdawn.slick.SlickException: Game.update() failure - check the game code.
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:663)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:408)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:318)
at javagame.MyGame.main(MyGame.java:37)
It's pretty clear from the exception that your "index" is "out of bounds" when you call getColor. In other words, the x/y values you are passing to getColor are out of bounds.
Also it seems like you didn't take our advice last time you asked for it -- you're still initting every state unnecessarily in your game class. Maybe you'd benefit by learning a bit more about Java and programming in general.
Next time please (a) post the exception (it will show up in Eclipse), (b) post a more succinct test so we don't need to trudge through hundreds of lines of code, (c) give more details about what the problem is
and how I might go about reproducing it.
