This is an AI agent. It starts off knowing nothing but passes its knowledge on to the next generation. If it hits something, it remembers that it is wrong. If it moves without touching the wall, it remembers that it is correct. It will use its memory to go along the path again and keep exploring. This is a very simple agent that works differently from real learning AI that use neural networks. It can only learn if the environment doesn't change. If you change the level, click the green flag to see it learn your new path. Make sure to change the starting position. Instant recall makes the agent not restart when touching walls.
Credits to other people who made AI agents on Scratch. my best ai: 12 generations, 106 skill Changelog: v1: basic action and movement learning, ~70-80 generations to finish course and ~350 skill v2: directional learning, requires more training but less skill (more efficient route), ~200-1000 generations and ~150 skill, bigger player v3: smoother movements for extremely accelerated learning and evolution, less training, ~very few generations, ~120 skill, smaller player