I'm just wondering how do you make AI fire at the player's spaceship. Any ideas? Here is the code for one of the AI spaceships:
/**
* Write a description of class Enemy_Spaceship_2 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Enemy_Spaceship_2 extends Actor
{
/**
* Act - do whatever the Enemy_Spaceship_2 wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
setRotation (180);
flySpaceship();
}
public void flySpaceship()
{
move(2);
if(isAtEdge())
{
setLocation(550,150);
}
}
