Just press green flag and watch. It is the best agent I've got after more than 3k generations. The only information that the network recieves is the distance to a wall for the 7 directions that the rays point to. This is just a showcase of what a neural network can do, but the same algorythim can be applied for any other game. This neural network has 2 hidden layers, and I can change the number of neurons per layer (including the input and output layers.) There is a variable for each layer. More a genetic algorythm than other thing
Since I saw @SpicyLemon's project (https://scratch.mit.edu/projects/416664691/) I've been wanting to create something like that. @bobojoeho for the line/line collision detection script