I have another problem now. im trying to implement the input system inside the class that creates the cube but when I start the applications it trows a nullpointer exception.
My second question for today is then: is there a way of setting inputs in separate classes or am I forced to fill the Main like an egg? Thanks in advance, Imma go and take a nap now
Iām allergic to appstates and I just create an interface āKeyInputā, of which every class that might take keys implements. The interface defines a method āinputKey(String key, boolean pressed)ā. In main I usually just keep a reference to an KeyInput object, or a list of them so all the things that are currently taking input are in the list. AppStates are probably better.
And in the future, donāt bother to even mention an exception without a stack trace. Itās no more useful than āit didnāt workā on the scale of useful information. Always include a stack trace. Always always.
AppStates is kinda useful because it is easily accessed using StateManager from anywhere, I am abusing this in my code because I am still working on getting better understanding of what should be where.
Thanks a whole lot to each and every one of you, I messed around a little bit with AppStates and I managed to solve my input problem and even store materials separately from the Main class.