place blocks/walls with the mouse hit space to watch the little orange square find his way from the blue tile to the green tile - updates in real time so you can add new blocks - has a butt load of problems with it because I don't usually work with such complicated ideas. haha :D I still wanna keep improving this. Maybe I'll make a tower defence game with it.
based on the Dijkstra's algorithm basic idea is the board scans the best route from the end (it's filled with the value of 0) then checks the surrounding tiles, it labels each 1-4 (unless there's a wall, so it can't label it) it then does the same for the tile it labeled 1 and labels it's surrounding tiles with the next possible values - i.e. 5-8 and then does the same again for tile 2. It keeps going until it fills every tile it can from there the little orange square goes to the start tile, then checks each surrounding tile for the lowest value it can find, then sticks that in it's memory, it jumps to the tile it recorded and does the same again - it keeps going and going until it reaches the end (conveniently labeled 0 - so it's always the lowest value) the hardest part of this was checking what tile you where on and then getting the little dude to move from each tile - because once we make a grid you're no longer messing around with coordinates and instead have to convert everything back and forth - a huge pain.