From f626ff2cc9d4df9d7a7f1cdfc0c4a1321a07c7d4 Mon Sep 17 00:00:00 2001 From: Bluwww Date: Mon, 15 Dec 2025 22:35:25 +0700 Subject: [PATCH] debug --- Script.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Script.js b/Script.js index db1a1ee..0709649 100644 --- a/Script.js +++ b/Script.js @@ -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 = [];