Experiment with ai
goal is to make an entertaining one rather than a truly intelligent one
what it attempts to do is figure out where it can see you ( the mouse pointer in this case)
and move towards that point
if it cannot see you it gets bored and
walks around in a seemingly random pattern (but actually it tries to guess the path to take to find you, so it's cheating because it knows your position regardless, just pretends it doesn't)
write a small script engine, where it can generate and parse all on it's own. provide some basic commands and constraints for this script engine as to what it can do with the canvas, or what objects it has domain over within the canvas, then add some basic rule set like for trial & error -or a problem-solving process like the 'scientific method' that is used for generating new code or editing what it already 'knows'
i got pretty close to true AI a year or two ago, writing the same concept in a different language. each AI has two threads, first thread is the execution of it's code, second thread is reflection of code. through reflection it constantly produces new situations depending on your rule set. the way i think about it: apply basic parsing techniques that humans demonstrate intuitively, as a rule set for the AI. although this skips the idea of genetic algorithms (at least in a fundamental form) it doesn't restrict it from growing into an algorithm from that point, but merely constraints it and provides guidelines to facilitate that process (like giving a human baby problem-solving wisdom of an old man)
i suppose what would make it close to "true AI' even though it intuitively, is not, is the fact that it reflects upon it's code using a rule set. the only problem i can see is not providing enough constraints and the execution thread mimicing or overriding the reflection thread, that would be a mess