double missile
This commit is contained in:
parent
f626ff2cc9
commit
4eead59af7
40
Script.js
40
Script.js
@ -66,6 +66,11 @@ playerShipImg.src = "img/Player/pesawat22.png";
|
|||||||
var missilePickupImg = new Image();
|
var missilePickupImg = new Image();
|
||||||
missilePickupImg.src = "img/Skills/missile.png";
|
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();
|
var bg0 = new Image();
|
||||||
bg0.src = "img/bg_0.png";
|
bg0.src = "img/bg_0.png";
|
||||||
var bg1 = new Image();
|
var bg1 = new Image();
|
||||||
@ -1116,23 +1121,33 @@ class AbilityToken {
|
|||||||
draw() {
|
draw() {
|
||||||
ctx.save();
|
ctx.save();
|
||||||
|
|
||||||
if (this.type === "missile") {
|
// --- GAYA METAL SLUG (KOTAK PUTIH TEBAL) UNTUK MISSILE & DOUBLE LASER ---
|
||||||
// --- METAL SLUG STYLE OUTLINE (KOTAK PUTIH TEBAL) ---
|
if (this.type === "missile" || this.type === "double") {
|
||||||
ctx.strokeStyle = "#ffffff";
|
ctx.strokeStyle = "#ffffff";
|
||||||
ctx.lineWidth = 3;
|
ctx.lineWidth = 3;
|
||||||
ctx.strokeRect(this.x, this.y, this.width, this.height);
|
ctx.strokeRect(this.x, this.y, this.width, this.height);
|
||||||
|
|
||||||
// Gambar Roket Piksel di dalamnya dengan sedikit padding
|
|
||||||
const padding = 4;
|
const padding = 4;
|
||||||
ctx.drawImage(
|
let imgToDraw = null;
|
||||||
missilePickupImg,
|
|
||||||
this.x + padding,
|
if (this.type === "missile") {
|
||||||
this.y + padding,
|
imgToDraw = missilePickupImg;
|
||||||
this.width - padding * 2,
|
} else if (this.type === "double") {
|
||||||
this.height - padding * 2
|
// 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 {
|
} else {
|
||||||
// --- GAYA LAMA (ORB LINGKARAN) UNTUK BOMB & DOUBLE ---
|
// --- GAYA LAMA (ORB LINGKARAN) HANYA UNTUK BOMB ---
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
const cx = this.x + this.width / 2;
|
const cx = this.x + this.width / 2;
|
||||||
const cy = this.y + this.height / 2;
|
const cy = this.y + this.height / 2;
|
||||||
@ -1144,9 +1159,6 @@ class AbilityToken {
|
|||||||
if (this.type === "bomb") {
|
if (this.type === "bomb") {
|
||||||
g.addColorStop(0.5, "#ffff00"); // Kuning
|
g.addColorStop(0.5, "#ffff00"); // Kuning
|
||||||
g.addColorStop(1, "#ff9900");
|
g.addColorStop(1, "#ff9900");
|
||||||
} else if (this.type === "double") {
|
|
||||||
g.addColorStop(0.5, "#ff3333"); // Merah
|
|
||||||
g.addColorStop(1, "#990000");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.fillStyle = g;
|
ctx.fillStyle = g;
|
||||||
|
|||||||
BIN
img/Skills/double-missile.png
Normal file
BIN
img/Skills/double-missile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 343 KiB |
Loading…
x
Reference in New Issue
Block a user