double missile

This commit is contained in:
Bluwww 2025-12-15 22:57:09 +07:00
parent f626ff2cc9
commit 4eead59af7
2 changed files with 26 additions and 14 deletions

View File

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB