diff --git a/Script.js b/Script.js index 0709649..8e6cf5c 100644 --- a/Script.js +++ b/Script.js @@ -66,6 +66,11 @@ playerShipImg.src = "img/Player/pesawat22.png"; var missilePickupImg = new Image(); missilePickupImg.src = "img/Skills/missile.png"; +// *** GAMBAR BARU UNTUK PICKUP LASER *** +var laserPickupImg = new Image(); +// Pastikan file gambar laser clay Anda disimpan di sini +laserPickupImg.src = "img/Skills/double-missile.png"; + var bg0 = new Image(); bg0.src = "img/bg_0.png"; var bg1 = new Image(); @@ -1116,23 +1121,33 @@ class AbilityToken { draw() { ctx.save(); - if (this.type === "missile") { - // --- METAL SLUG STYLE OUTLINE (KOTAK PUTIH TEBAL) --- + // --- GAYA METAL SLUG (KOTAK PUTIH TEBAL) UNTUK MISSILE & DOUBLE LASER --- + if (this.type === "missile" || this.type === "double") { ctx.strokeStyle = "#ffffff"; ctx.lineWidth = 3; ctx.strokeRect(this.x, this.y, this.width, this.height); - // Gambar Roket Piksel di dalamnya dengan sedikit padding const padding = 4; - ctx.drawImage( - missilePickupImg, - this.x + padding, - this.y + padding, - this.width - padding * 2, - this.height - padding * 2 - ); + let imgToDraw = null; + + if (this.type === "missile") { + imgToDraw = missilePickupImg; + } else if (this.type === "double") { + // GUNAKAN GAMBAR LASER PICKUP YANG BARU + imgToDraw = laserPickupImg; + } + + if (imgToDraw) { + ctx.drawImage( + imgToDraw, + this.x + padding, + this.y + padding, + this.width - padding * 2, + this.height - padding * 2 + ); + } } else { - // --- GAYA LAMA (ORB LINGKARAN) UNTUK BOMB & DOUBLE --- + // --- GAYA LAMA (ORB LINGKARAN) HANYA UNTUK BOMB --- ctx.beginPath(); const cx = this.x + this.width / 2; const cy = this.y + this.height / 2; @@ -1144,9 +1159,6 @@ class AbilityToken { if (this.type === "bomb") { g.addColorStop(0.5, "#ffff00"); // Kuning g.addColorStop(1, "#ff9900"); - } else if (this.type === "double") { - g.addColorStop(0.5, "#ff3333"); // Merah - g.addColorStop(1, "#990000"); } ctx.fillStyle = g; diff --git a/img/Skills/double-missile.png b/img/Skills/double-missile.png new file mode 100644 index 0000000..6c2d451 Binary files /dev/null and b/img/Skills/double-missile.png differ