/*
 * Hud.java
 *
 * Created on 9 janvier 2005, 22:47
 */

package hyperion;
import java.lang.*;
import java.applet.*;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Color;
import java.awt.Font;

/**
 *
 * @author CryoGen
 */
public class Hud {
    static public Image life;
    
    private Vaisseau vs;
    private Applet applet;
    
    private Integer score;
    private Integer high_score;
    
    /** Creates a new instance of Hud */
    public Hud(Vaisseau vs, Applet applet) {
        this.vs = vs;
        this.applet = applet;
        
        this.score = 0;
    }
    
    public void updateScore(int inc) {
        this.score += inc;
    }
    
    public void setHighScore(int scr) {
        this.high_score = scr;
    }
    
    public void draw(Graphics g)
    {
        Integer bouclier = vs.getBouclier();
        g.setColor(Color.GREEN);
        g.drawRect(17, 449, 101, 20);
        
        g.setColor(Color.CYAN);
        g.fillRect(18, 450, vs.getBouclier(), 19);
        g.setColor(Color.RED);
        Font f = new Font("TimesRoman", Font.BOLD, 20);
        g.setFont(f);
        g.drawString(bouclier.toString(), 50, 463); 
        
        for( int i = 0; i < vs.getVie(); i++) {
            g.drawImage(life, i*45, 390, applet);
        }
        
       g.setColor(Color.GRAY);
       g.drawString("Score: " + score.toString(), 0, 20);
        
        
        
    }
}
