I have a program where there are two shapes Player1 and Player2, both inherited by the class Player.
Public class Player{
public int xPos;
public int yPos;
// more code
}
The player1 class:
Public class Player1 extends Player{
public Player(){
xPos = 200;
yPos = 200;
}
// more code
}
The Player2 class:
Public class Player2 extends Player{
public Player2(){
xPos = 400;
yPos = 200;
}
// more code
}
In this case, should I use static for the xPos and yPos in the Player class?
If xPos and yPos were static, every instance of a Player would have the same position.