Ok , I've never done this before, but I'd like to make it so an enemy can shoot "plasma"(the 'bullet') at the player when it's facing the player , every so often.
Thanks,
Hawx
public class Player
{
public static int playerX;
public static int playerY;
public void act()
{
setCoordinates();
//and the whole other things
}
public void setCoordinates()
{
playerX=getX();
playerY=getY();
}
}public class Enemy
{
public void act()
{
turnTowards(Player.playerX,Player.playerY);
shoot();
}
}public void shoot()
{
darkPlasma d = new darkPlasma();
getWorld().addObject(d, getX(), getY());
d.setRotation(getRotation());
d.move(halfLengthOfTheShootingObject);
}
public void act()
{
move(speed); //type in how fast the plasma should be
}