1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
| public void draw (Graphics g) { ImageIcon b = new ImageIcon("res/HUD.png"); image = b.getImage(); g.drawImage(image, 0, 0, null); if(store == false){ for(int i=0;i<button.length;i++) { 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); 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); } 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); } } |