
/**
 * Abstract class NPC - write a description of the class here
 * 
 * @author (your name here)
 * @version (version number or date here)
 */


import java.lang.*;
import java.applet.*;
import java.awt.*;
import javax.swing.*;


public abstract class NPC extends Actor implements Runnable
{

    // instance variables
    Thread t;
    int maxVelocity, health;
    double speed, speedX, speedY, dmgMod, armorMod;
    Image characterImage;
    
    public NPC(Image img1, Image img2, int startX, int startY, int radius)
    {
        x = startX; y = startY; r = radius;
        characterImage = img1;
        deadImage = img2;
    }
    
    public int getPosX()
    {
        return (int)x;
    }    
    public int getPosY()
    {
        return (int)y;
    }
    
    public Image characterImage()
    {
        return characterImage;
    }

    public void takeDmg(int x)
    {
        health = (int)Math.floor(health - (x * armorMod));
    }
    

    public void run()
    {
        while(true)
        {
            x += speedX;
            y += speedY;
            try {
                t.sleep(16);
            } catch (InterruptedException e)
            { ; }
        }
    }
    
    
    
}

