[LibGDX] Forward Scrolling Space Shooter AI?

I need to know how to make an AI for my game this is something I am new to.
things that the AI needs to do:

  • Shoot A Player
  • Not collide with other enemies/player
  • Act differently based on health
  • move towards player is able to

I have already created the enemies and stuff I just need to know how to make them “smart” and actually attack and stuff.

Thanks for the help!!!

I just need to be pointed in the right direction

Please don’t re-post question: http://www.java-gaming.org/topics/forward-scrolling-space-shooter-ai/34470/view/topicseen.html

Sorry I just have been trying to get the answered for awhile now

Get yourself “Programming Game AI by Example” from Buckland.


if (health > 2) {
     attackPlayer();
} else {
     runAway();
}

if (playerVisible() && playerInRange()) {
     shootBulletToPlayer();
}

I always think something like this is a worthwhile addition: