I'm trying to write a simplified google maps programme using javafx classes. I've stored the image strings in a matrix of string. I then use button fields to trigger functions that move through the matrix to show the appropriate picture. If the neighbouring matrix element is null then the respective button is then hidden, so you can't walk through a wall.
forward = y+2
backwards = y-2
left(90 degrees) = x-1
right = x+1
my problem is that in my program you can't keep clicking left or right and rotate through 360 degrees, 90 degrees at a time, you can only click left or right once. I had to make forward and backward y+-2 because the 'backwards view' picture is y+1. Is there a way I can say..
upon the first click of left button do x = x-1; upon the second click do y = x - 2; etc...
private button = Forwards;
private button = Backwards;
etc...
private ImageView = mainDisplay;
private int x = 10;
private int y = 10;
String[][] ImageURLs = new String[x][y];
//load images into matrix//
ImageURLs[0][0] = "....jpg";
ImageURLs[0][1] = "....jpg";
ImageURLs[0][2] = "0";
public void Forward(ActionEvent event) {
y = y+2;
x = x;
Image image = new Image(ImageURLs[x][y]);
//if ImageURLs[x][y+1] = null
//hide button//
mainDisplay.setImage(image);
}