This commit is contained in:
Bluwww 2025-12-15 22:35:25 +07:00
parent 2b55cdc7a4
commit f626ff2cc9

View File

@ -63,8 +63,6 @@ var keys = {
var playerShipImg = new Image();
playerShipImg.src = "img/Player/pesawat22.png";
// *** GAMBAR BARU UNTUK PICKUP MISSILE ***
// Pastikan file gambar "missile_pickup.png" ada di folder img Anda
var missilePickupImg = new Image();
missilePickupImg.src = "img/Skills/missile.png";
@ -372,6 +370,7 @@ function drawGame() {
if (!player1.dead && Math.random() < shootChance && s.x > player1.x + 50) {
const ex = s.x;
const ey = s.y + s.height / 2;
const px = player1.x + player1.width / 2;
const py = player1.y + player1.height / 2;
enemyBulletsArray.push(new EnemyBullet(ex, ey, px, py));
@ -831,15 +830,16 @@ class PlayerMissile {
draw() {
ctx.save();
// WARNA BIRU
let g = ctx.createLinearGradient(
this.x,
this.y,
this.x + this.width,
this.y
);
g.addColorStop(0, "#00008b");
g.addColorStop(0.5, "#4169e1");
g.addColorStop(1, "#ffffff");
g.addColorStop(0, "#00008b"); // Dark Blue
g.addColorStop(0.5, "#4169e1"); // Royal Blue
g.addColorStop(1, "#ffffff"); // White nose
ctx.fillStyle = g;
ctx.beginPath();
@ -848,6 +848,7 @@ class PlayerMissile {
ctx.lineTo(this.x, this.y + this.height);
ctx.fill();
// TRAIL BIRU LANGIT
if (Math.random() < 0.5) {
createParticles(this.x, this.y + this.height / 2, 2, "#00bfff");
}
@ -1177,6 +1178,8 @@ function useAbility() {
enemyShipArray.forEach((e) => {
explosions.push(new Explosion(e.x + e.width / 2, e.y + e.height / 2));
createParticles(e.x + e.width / 2, e.y + e.height / 2, 20, "#ff9900");
// --- FIX: Tambah Score ---
player1.score += 100 + game.level * 10;
});
enemyShipArray = [];