I know this question has been asked several times already, but I tried a few solutions I found on this site but none of them actually worked.
This is what I currently have:
But it doesn't work at all. Even if the Pacman actor is touching a blue wall, it continues on without executing the code inside the if block. Is there a better way/ Am I doing something wrong?
Maze with blue walls:
Pacman: https://drive.google.com/file/d/1f1urYhwxYGrhouCJdVFw4Ifz_rKtXyW2/view
1 2 3 4 5 6 7 | Color mazeColor = new Color ( 0 , 0 , 225 ); Color pacmanColor = getImage().getColorAt( 37 / 2 , 42 / 2 ); //Pacman is 37 x 42 if (pacmanColor.equals(mazeColor)) { // Stuff that I want to do } |