When creating a clone of the game Flappy Bird - “swears” to the ResourceLoader class, enter the code here, cannot load the logo, selects the initial-and-logo line in the load() method. What can be wrong? Here is the error code:
Exception in thread "LWJGL Application" java.lang.NullPointerException at com.badlogic.gdx.graphics.g2d.TextureRegion.setRegion(TextureRegion.java:112) at com.badlogic.gdx.graphics.g2d.Sprite.<init>(Sprite.java:83) at pavel.example.flygame.loader.ResourceLoader.load(***ResourceLoader.java:23***) at pavel.example.flygame.FlyGame.create(***FlyGame.java:12***) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:147) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124) Here are the lines referenced:
public static void load(){ atlas=new TextureAtlas(Gdx.files.internal("texture/texture.pack"),true); logo = new Sprite(atlas.findRegion("logo")); ..... } and
public void create() { ResourceLoader.load(); setScreen(new SplashScreen(this)); }