what engine do you use. perhaps I could help.
well I'm using phaser.js but I made the ai this morning now you can play with it :) Enjoy !