import java.awt.*;

public class Die {
	public int value;

	public Die() {
		value = 0;
	}
	
	public void rollValue(int maxValue) {
		double tempValue = Math.random() * maxValue;
		value = (int) Math.floor( tempValue ) + 1;
	}

	public void drawDie(Graphics screen, int x, int y) {
		screen.setColor(Color.red);
		screen.fillRoundRect(x, y, 100, 100, 20, 20);
		screen.setColor(Color.black);
		screen.drawRoundRect(x, y, 100, 100, 20, 20);	
		screen.setColor(Color.white);
		if (value > 1) {
			screen.fillOval(x+5, y+5, 20, 20 );
			screen.fillOval(x+75, y+75, 20, 20 );
		}
	if (value > 3) {
		screen.fillOval(x+75, y+5, 20, 20 );
		screen.fillOval(x+5, y+75, 20, 20 );
	}
	if (value == 6) {
		screen.fillOval(x+5, y+40, 20, 20 );
		screen.fillOval(x+75, y+40, 20, 20 );
	}
	if (value % 2 == 1) {
		screen.fillOval(x+40, y+40, 20, 20 );
		}
	}
}