In reply to Ifelse: [well, chatgpt cooking it, bot can control game but only one side (up-down-right-left) depends on bluestack size, code can identify snake head and food, but can't follow logic, what should i search next?]
Sorry was busy yesterday. From what I understand you need some simple path searching algorithm. You can cut the image into a simple matrix in relation to the squares and then the algorithm would make a path from the head of the track to the food. In your case you don't need anything fancy nor diagonal movement and simple adding/substracting of coordinates would do. For example If the head is in x:0 y:0 and the food is at x:5 y:8, the algorithm should simply add these coordinates and depending on what you add you then apply movement: if x:1 then we move right, if x:-1 then left, if y: 1 then down, if y:-1 then up. Until we reach the destination coordinates, which is head.x == destination.x