So I have been trying to fix this for nearly an hour now, but I am truly clueless… In my class MainGame
i define 2 floats:
private float levelX = -500;
private float levelY = -500;
and I also define a getter for both of those. When you press the up arrow key the levelY
is decreased (using libgdx so it may be irregular seeing something like this) And I do the same for the rest of my arrow keys. Now the problem is when I am trying to use the value of the levelX
or levelY
in another class it always returns as -500 even though if I print out the value in the MainGame class it is changed from that original -500 but not in the other class… Is this some stupid error I am not picking up on here or is it something deeper ?