java - Unknown NullPointerException in Slick2D -


i trying understand basics of making game in slick2d. have 4 classes: main, entity, misc (pastebin.com/e5wqf6ma) , fish (pastebin.com/ie0anxxx)

whenever run code, console log.

mon aug 17 00:15:07 bst 2015 info:slick build #237 mon aug 17 00:15:07 bst 2015 info:lwjgl version: 2.9.3 mon aug 17 00:15:07 bst 2015 info:originaldisplaymode: 1366 x 768 x 32 @60hz mon aug 17 00:15:07 bst 2015 info:targetdisplaymode: 640 x 480 x 0 @0hz mon aug 17 00:15:08 bst 2015 info:starting display 640x480 mon aug 17 00:15:08 bst 2015 info:use java png loader = true mon aug 17 00:15:08 bst 2015 info:controllers not available exception in thread "main" java.lang.nullpointerexception     @ com..prototypes.project_blueberry.util.misc.addid(misc.java:24)     @ com..prototypes.project_blueberry.util.entity.<init>(entity.java:16)     @ com..prototypes.project_blueberry.entity.fish.<init>(fish.java:15)     @ com..prototypes.project_blueberry.main.init(main.java:56)     @ org.newdawn.slick.appgamecontainer.setup(appgamecontainer.java:393)     @ org.newdawn.slick.appgamecontainer.start(appgamecontainer.java:317)     @ com..prototypes.project_blueberry.main.main(main.java:44) 

i have taken out bits off stuff don't want online, majority of stuff there.

i have tried troubleshoot code, can't figure out causing exception. help? thanks.

the problem here haven't initialize integer array in misc.java class. if need store values integer array have initialize given size.

private static int[] ids = new int[10]; 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -