Null Pointer Exception while using a 2D array?
You’re not checking to make sure that PlayerX -1 is inside your array. The null pointer exception makes me think you’re outside of it. This may not have anything to do with your problem, just readability for someone trying else trying to help you debug it, but in two dimensions, X is usually the horizontal axis(left or right) and Y is vertical ( up or down). Without the method name, I’d assume that this function moves one to the left.