In your Player
constructor, this line
System.out.println("x: " + this.x + " this.y: " + y);
is using the Player
version of x
and y
, which are being ignored by your code, and therefore have the default initial values for ints, which is zero. I think you want to eliminate this
private int x = 0;
private int y = 0;
from your Player
class, which would then cause your code to access the GameObject
version of x
and y
, which is your goal.