I have a method in a class that sets "Position X" and "Position Y".
public class Player {
int positionX, postinionY;
public void setPosition (int position_X, int position_Y)
{
positionX = position_X;
postinionY = position_Y;
}
}
I have another class "World" that has an array in it called grid. I have to use the values of position x and y from Player to get location from the grid.
public class World extends Player {
int [] [] grid = new int [16] [16];
public int getLocationID (int x, int y)
{
return grid [x][y];
}
}
I need help to take Position x,y(Player) and use them instead x,y (World)