We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Here is my code: http://pastebin.com/ZybVvs3C (expires in 1 week to avoid spoilers) And here is the error it throws.
java.lang.NullPointerException at processing.awt.PGraphicsJava2D.getRaster(PGraphicsJava2D.java:2717) at processing.awt.PGraphicsJava2D.loadPixels(PGraphicsJava2D.java:2741) at processing.opengl.PGraphicsOpenGL.initCache(PGraphicsOpenGL.java:6429) at processing.opengl.PGraphicsOpenGL.getTexture(PGraphicsOpenGL.java:6382) at processing.opengl.PGraphicsOpenGL$TexCache.getTexture(PGraphicsOpenGL.java:7426) at processing.opengl.PGraphicsOpenGL.flushPolys(PGraphicsOpenGL.java:2404) at processing.opengl.PGraphicsOpenGL.flush(PGraphicsOpenGL.java:2345) at processing.opengl.PGraphicsOpenGL.endDraw(PGraphicsOpenGL.java:1526) at processing.core.PApplet.handleDraw(PApplet.java:2421) at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:861) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81) at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452) at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)
Oh and BTW Line 26 should be with size(854, 480, P2D) not JAVA2D but I was testing all the modes so you know. Also I tried FX2D but the keyboard input doesn't seem to work.
Answers
This exception usually occurs when you reference a variable that has no value attached to it.