This is a cool idea. Though, the implementation might be a bit too simple. The AI always takes a perfect shot with 100% accuracy that never misses. It's so perfect that it shoots in a direction before the barrel of the cannon fully rotates. This isn't necessarily a bad thing, buuuuuut maybe your main idea can be taken a bit further and in a more interesting direction. Nonetheless, well done on your game! Just a few ideas to consider:
What if the player moving around messed up the AI's accuracy?
What if bullets bounced off of the wall? (and how would the AI handle this?)
What if the AI waited until the player placed itself in a position that allows the AI to line up an optimal shot? (i.e: shoot a bullet through multiple enemies at once)