/*
 * Item.java
 *
 * Created on 4 janvier 2005, 17:12
 */

package hyperion;
import java.applet.*;
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Image;
/**
 *
 * @author CryoGen
 */
public class Item extends Entity {
    static public Image imgWeapon1, imgWeapon2;
    static public Image shield;
    static public Image score;
    static public Image speed;
    static public Image clone;
    static public Image invincible;
    
    private Image current;
    private Animation anime;
    private float pos_imgf;
    
    
    public static final int WEAPON = 1;
    public static final int WEAPON_TYPE_1 = 1;
    public static final int WEAPON_TYPE_2 = 2;
    public static final int SHIELD = 2;
    public static final int SCORE = 3;
    public static final int CLONE = 4;
    public static final int INVI = 5;
    
    /** Creates a new instance of Item */
    public Item(int x, int y, int type, int stype, Applet applet) {
        this._x = x;
        this._y = y;
        this.width = 32;
        this.height = 32;
        
        this.type = type;
        this.stype = stype;
        
        
        
        switch(type)
        {
            case WEAPON: //Weapon
                switch(stype)
                {
                    case WEAPON_TYPE_1: current = imgWeapon1; break;
                    case WEAPON_TYPE_2: current = imgWeapon2; break;
                }
                
                anime = new Animation(current, 42, 42, 336, applet);
                anime.setSpeed(0.2f);
                break;
                
            case SHIELD:
                current = shield;
                anime = new Animation(current, 42, 42, 336, applet);
                anime.setSpeed(0.2f);
                break;
                
            case SCORE:
                current = score;
                anime = new Animation(current, 42, 42, 336, applet);
                anime.setSpeed(0.2f);
                break;
            
            case INVI:
                current = invincible;
                anime = new Animation(current, 42, 42, 336, applet);
                anime.setSpeed(0.2f);
                break;
                
            case CLONE:
                current = clone;
                anime = new Animation(current, 26, 26, 156, applet);
                anime.setSpeed(0.2f);
                break;
                    
            default:break;
        }
        
        
    }
    
   
    
    public void draw(Graphics g) {
        anime.draw(g, _x, _y);
    }
            
}
