I am having trouble coming up with how To construct the AI in my platformer. I have 3 enemy types. 1 is a ground type that payrolls a certain spot. I want them to move back and forth but when the player get in range I want them to shoot at them. But I want only a certain number of bullets to be fired. Second type is a flying unit that will swoop down at the player and drop bombs. Third is the boss who I want to have multiple attacks that they use randomly. Also is there a way to limit the number of shots on screen. Right now I have the fire button attached to space bar but you can spam the weapon. Thanks for any help. If I need to provide any more details let me know. Sorry if this seems like an easy or stupid question.