the store boolean is only for to show if the store is on, I’ll post some pictures about it,
Store true;
http://img820.imageshack.us/img820/4817/storeon.jpg
Store false && UpgradeScreen= 1;
http://img21.imageshack.us/img21/8179/storeoff.jpg
Store draw script:
public void draw (Graphics g) {
ImageIcon b = new ImageIcon("res/HUD.png");
image = b.getImage();
g.drawImage(image, 0, 0, null);
if(store == false){
//Makes Buttons
for(int i=0;i<button.length;i++) {
//Sell
if(button[i].contains(Screen.mse)) {
g.setColor(new Color(255,255,255,120));
g.fillRect(500, 443+6, 52, 52);
}
g.drawImage(Screen.tileset_res[0], 500, 443+6, 52, 52, null);
g.drawImage(Screen.tileset_air[Value.airSell], 500, 443+6, 52, 52, null);
//Upgrade
if(button[i].contains(Screen.mse)) {
g.setColor(new Color(255,255,255,120));
g.fillRect(440, 443+6, 52, 52);
}
g.drawImage(Screen.tileset_res[0], 440, 443+6, 52, 52, null);
g.drawImage(Screen.tileset_air[Value.airUpgrade], 440 , 443+6, 52, 52, null);
}
//Showing the tower stats.
g.setFont(new Font("Courier New", Font.BOLD, 18));
g.setColor(new Color(41,41,41));
g.drawRect(198, 443, 154, 64);
g.drawRect(199, 444, 152, 62);
g.setColor(new Color(98,98,98,120));
g.fillRect(200, 445, 151, 61);
g.setColor(new Color(41,41,41));
g.drawString(" TOWER STATS", 200, 458);
g.setFont(new Font("Courier New", Font.BOLD, 14));
if (UpgradeScreen== 1) {
g.drawString(" Damage: 20", 200, 470);
g.drawString(" Range: 180", 200, 480);
g.drawString(" Rate Of Fire: 100", 200, 490);
g.drawString(" Sell Price: 10", 200, 500);
}
if (UpgradeScreen== 2) {
g.drawString(" Damage: 35", 200, 470);
g.drawString(" Range: 140", 200, 480);
g.drawString(" Rate Of Fire: 150", 200, 490);
g.drawString(" Sell Price: 30", 200, 500);
}
if (UpgradeScreen== 3) {
g.drawString(" Damage: 60", 200, 470);
g.drawString(" Range: 100", 200, 480);
g.drawString(" Rate Of Fire: 175", 200, 490);
g.drawString(" Sell Price: 60", 200, 500);
}
if (UpgradeScreen== 4) {
g.drawString(" Damage: 10", 200, 470);
g.drawString(" Range: 150", 200, 480);
g.drawString(" Rate Of Fire: 300", 200, 490);
g.drawString(" Sell Price: 20", 200, 500);
}
if (UpgradeScreen== 5) {
g.drawString(" Damage: 15", 200, 470);
g.drawString(" Range: 175", 200, 480);
g.drawString(" Rate Of Fire: 350", 200, 490);
g.drawString(" Sell Price: 45", 200, 500);
}
if (UpgradeScreen== 6) {
g.drawString(" Damage: 30", 200, 470);
g.drawString(" Range: 200", 200, 480);
g.drawString(" Rate Of Fire: 450", 200, 490);
g.drawString(" Sell Price: 90", 200, 500);
}
}
if(store == true) {
for(int i=0;i<button.length;i++) {
if(button[i].contains(Screen.mse)) {
g.setColor(new Color(255,255,255,120));
g.fillRect(button[i].x, button[i].y, button[i].width, button[i].height);
}
g.drawImage(Screen.tileset_res[0], button[i].x, button[i].y, button[i].width, button[i].height, null);
if(buttonID[i] != Value.airAir)g.drawImage(Screen.tileset_air[buttonID[i]], button[i].x + itemIn, button[i].y + itemIn, button[i].width - (itemIn*2), button[i].height - (itemIn*2), null);
if(buttonPrice[i] > 0) {
g.setFont(new Font("Courier New", Font.BOLD, 14));
g.setColor(new Color(41,41,41));
g.drawString("€" +buttonPrice[i] + ",-", button[i].x + itemIn, button[i].y + itemIn + 62);
}
}
}
g.drawImage(Screen.tileset_res[1], buttonHealth.x, buttonHealth.y, buttonHealth.width, buttonHealth.height, null);
g.drawImage(Screen.tileset_res[2], buttonCoins.x, buttonCoins.y, buttonCoins.width, buttonCoins.height, null);
g.drawImage(Screen.tileset_res[3], buttonKilled.x, buttonKilled.y, buttonKilled.width, buttonKilled.height, null);
g.setFont(new Font("Courier New", Font.BOLD, 14));
g.setColor(new Color(236, 0, 0));
g.drawString("" + Screen.health +"/" + Screen.maxHealth, buttonHealth.x + buttonHealth.width + iconSpace, buttonHealth.y + iconTextY);
g.setColor(new Color(255, 205, 6));
g.drawString("" + Screen.money, buttonCoins.x + buttonCoins.width + iconSpace, buttonCoins.y + iconTextY);
g.setColor(new Color(190, 189, 187));
g.drawString("" + Screen.killed, buttonKilled.x + buttonKilled.width + iconSpace, buttonKilled.y + iconTextY);
g.setColor(new Color(255, 255, 255));
if(holdsItem) {
g.drawImage(Screen.tileset_air[heldID], Screen.mse.x - ((button[0].width - (itemIn*2) )/2) + itemIn, Screen.mse.y - ((button[0].width - (itemIn*2) )/2) + itemIn, button[0].width - (itemIn*2), button[0].height - (itemIn*2), null);
}
}