User prompt
HP yazısını stage yazısının 2 satır altına taşı.
User prompt
Oyunda HP sistemi olsun. Düşen topların sayısı kadar HP azalsın. Mesela 3 sayılı top geçerse, 3 can azalsın. Gibi.
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Topları gönderdikten sonra kendimiz de tıklama yaparak top gönderebilelim. Normal topun hasarının %50 daha düşük olsun.
User prompt
Add combo multiplier visual effects with dynamic scaling ✅ Add magnetized ball class that attracts projectiles ✅ Add critical hit visual effects and damage multiplier ✅ Add magnet ball spawning to level generation ✅ Add special weapon combo system ✅ Add magnet ball collision and attraction effects ✅ Add special victory conditions and epic win effects ✅ Add power-up combo system to track active effects ✅ Add special ball destruction tracking for achievements 🔄 Add lucky shot tracking from long distance ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Create the image file behind the achievements button and the achievements text in it.
User prompt
Hız artırma bölgeleri ile ilgili herşeyi sil. Olmasın oyunda.
User prompt
Başarımların olduğu buton ekle ve birbirinden farklı, oyun özelliklerinden oluşan 50 başarım ekle. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Add combo multiplier display and visual feedback ✅ Add rainbow ball special enemy type ✅ Add bomb ball that explodes on impact ✅ Add spawning for rainbow and bomb balls ✅ Add special handling for rainbow and bomb balls in collision ✅ Add double shot power-up ✅ Add double shot spawning and variables ✅ Add double shot variables and update ✅ Add double shot update loop ✅ Add double shot movement ✅ Add double shot collision and effect ✅ Add double shot timer update ✅ Modify fireProjectiles to support double shot ✅ Add critical hit visual indicator ✅ Add perfect shot bonus ✅ Add speed boost zones visual indicator 🔄 Add projectile speed boost in zones
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Please fix the bug: 'Error: Invalid value. Only literals or 1-level deep objects/arrays containing literals are allowed.' in or related to this line: 'storage['99balls_save'] = savedData;' Line Number: 1191
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle. (alevli top, büyük top, çarpınca parçalanan top, çarpınca çoğalan top vs.)
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'var savedData = storage.get('99balls_save') || {};' Line Number: 353 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Error: Invalid value. Only literals or 1-level deep objects/arrays containing literals are allowed.' in or related to this line: 'storage['99balls_save'] = savedData;' Line Number: 919
User prompt
Sorunu çöz
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'var savedData = storage.get('99balls_save') || {};' Line Number: 353 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oluşturduğun özelliğin kodlamasına devam et. Yarım kaldı.
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'weaponText.style.fill = 0xFFFFFF;' Line Number: 758
User prompt
Kod içinde olan veya olmayan, oyuna uygun birçok özelliği aktif et. Uyumsuz ise ekleme. Birbirinden farklı, eğlence katacak özellik ekle.
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'call')' in or related to this line: 'AddBallButton.prototype.up.call(addBallButton, x, y, obj);' Line Number: 229
User prompt
3 top arka arkaya hizalı şekilde gitsin ve her seviye sonrası artsın. Bu sayıyı artırmak için buton ekle.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var AimLine = Container.expand(function () { var self = Container.call(this); for (var i = 0; i < 10; i++) { var dot = self.attachAsset('aimline', { anchorX: 0.5, anchorY: 0.5, y: -i * 30, alpha: 0.5 - i * 0.05 }); } return self; }); var Ball = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5 }); self.numberText = new Text2('1', { size: 40, fill: 0xFFFFFF }); self.numberText.anchor.set(0.5, 0.5); self.addChild(self.numberText); self.hits = 1; self.radius = 40; self.velocityX = 0; self.velocityY = 0; self.setNumber = function (num) { self.hits = num; self.numberText.setText(num.toString()); var scale = 1 + num / 50 * 0.5; ballGraphics.scale.set(scale); self.radius = 40 * scale; }; self.takeDamage = function () { self.hits--; if (self.hits <= 0) { return true; } self.numberText.setText(self.hits.toString()); tween(ballGraphics, { scaleX: 0.8, scaleY: 0.8 }, { duration: 100, onFinish: function onFinish() { tween(ballGraphics, { scaleX: 1, scaleY: 1 }, { duration: 100 }); } }); return false; }; return self; }); var Cannon = Container.expand(function () { var self = Container.call(this); var cannonGraphics = self.attachAsset('cannon', { anchorX: 0.5, anchorY: 0.8 }); self.rotation = 0; return self; }); var Particle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.attachAsset('projectile', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.5, scaleY: 0.5 }); self.velocityX = 0; self.velocityY = 0; self.lifetime = 30; self.fadeSpeed = 0.03; self.update = function () { self.x += self.velocityX; self.y += self.velocityY; self.velocityY += 0.5; // gravity self.lifetime--; self.alpha -= self.fadeSpeed; if (self.lifetime <= 0 || self.alpha <= 0) { return true; // destroy } return false; }; return self; }); var PowerUp = Container.expand(function () { var self = Container.call(this); var powerupGraphics = self.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5 }); self.radius = 20; return self; }); var Projectile = Container.expand(function () { var self = Container.call(this); var projectileGraphics = self.attachAsset('projectile', { anchorX: 0.5, anchorY: 0.5 }); self.velocityX = 0; self.velocityY = 0; self.speed = 15; self.radius = 10; self.update = function () { self.x += self.velocityX; self.y += self.velocityY; if (self.x <= self.radius || self.x >= 2048 - self.radius) { self.velocityX *= -1; self.x = Math.max(self.radius, Math.min(2048 - self.radius, self.x)); } if (self.y <= self.radius) { self.velocityY *= -1; self.y = self.radius; } }; return self; }); var SlowMotionPowerUp = Container.expand(function () { var self = Container.call(this); var powerupGraphics = self.attachAsset('powerup', { anchorX: 0.5, anchorY: 0.5, tint: 0x9b59b6 }); self.radius = 30; self.pulseTimer = 0; self.update = function () { self.pulseTimer += 0.1; var scale = 1 + Math.sin(self.pulseTimer) * 0.2; powerupGraphics.scale.set(scale); }; return self; }); var SpecialProjectile = Container.expand(function () { var self = Container.call(this); self.type = 'normal'; self.velocityX = 0; self.velocityY = 0; self.speed = 15; self.radius = 10; self.piercing = 0; self.bounces = 999; var projectileGraphics = self.attachAsset('projectile', { anchorX: 0.5, anchorY: 0.5 }); self.setType = function (type) { self.type = type; switch (type) { case 'piercing': projectileGraphics.tint = 0xff00ff; self.piercing = 3; projectileGraphics.scale.set(1.5); self.radius = 15; break; case 'explosive': projectileGraphics.tint = 0xff4444; projectileGraphics.scale.set(2); self.radius = 20; self.speed = 10; break; case 'rapid': projectileGraphics.tint = 0x44ff44; projectileGraphics.scale.set(0.7); self.radius = 7; self.speed = 25; break; } }; self.update = function () { self.x += self.velocityX; self.y += self.velocityY; if (self.x <= self.radius || self.x >= 2048 - self.radius) { self.velocityX *= -1; self.x = Math.max(self.radius, Math.min(2048 - self.radius, self.x)); self.bounces--; } if (self.y <= self.radius) { self.velocityY *= -1; self.y = self.radius; self.bounces--; } if (self.type === 'rapid') { // Add trail effect if (Math.random() < 0.3) { var trail = self.attachAsset('projectile', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.3, scaleY: 0.3, alpha: 0.5, tint: 0x44ff44 }); tween(trail, { alpha: 0, scaleX: 0, scaleY: 0 }, { duration: 300, onFinish: function onFinish() { trail.destroy(); } }); } } return self.bounces <= 0; }; return self; }); var Star = Container.expand(function () { var self = Container.call(this); var starGraphics = self.attachAsset('star', { anchorX: 0.5, anchorY: 0.5 }); self.radius = 25; starGraphics.rotation = Math.PI / 4; self.update = function () { starGraphics.rotation += 0.02; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2c3e50 }); /**** * Game Code ****/ var cannon; var aimLine; var balls = []; var projectiles = []; var powerups = []; var stars = []; var isAiming = false; var canShoot = true; var projectileCount = 1; var stage = 1; var ballsPerRow = 6; var ballSpeed = 0.5; var gameActive = true; var stageText = new Text2('Stage 1', { size: 60, fill: 0xFFFFFF }); stageText.anchor.set(0.5, 0); stageText.y = 20; LK.gui.top.addChild(stageText); var projectileCountText = new Text2('x1', { size: 50, fill: 0x4ECDC4 }); projectileCountText.anchor.set(0.5, 0); projectileCountText.y = 100; LK.gui.top.addChild(projectileCountText); var scoreText = new Text2('Score: 0', { size: 40, fill: 0xFFFFFF }); scoreText.anchor.set(1, 0); scoreText.x = -20; scoreText.y = 20; LK.gui.topRight.addChild(scoreText); var combo = 0; var comboTimer = 0; var scoreMultiplier = 1; var comboText = new Text2('', { size: 60, fill: 0xFFD700 }); comboText.anchor.set(0.5, 0.5); LK.gui.center.addChild(comboText); var particles = []; var currentWeapon = 'normal'; var weaponUnlocks = { piercing: false, explosive: false, rapid: false }; var slowMotionActive = false; var slowMotionTimer = 0; var gameSpeed = 1; var magnetActive = false; var magnetTimer = 0; var specialEffects = []; var chainReactionActive = false; var lastBallDestroyed = null; var consecutiveHits = 0; var slowMotionPowerups = []; var weaponText = new Text2('Normal', { size: 40, fill: 0xFFFFFF }); weaponText.anchor.set(0.5, 1); weaponText.y = -20; LK.gui.bottom.addChild(weaponText); var slowMotionOverlay = new Container(); var slowMotionBg = slowMotionOverlay.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5, scaleX: 50, scaleY: 50, alpha: 0, tint: 0x9b59b6 }); LK.gui.center.addChild(slowMotionOverlay); var powerUpIndicator = new Text2('', { size: 50, fill: 0xFFFFFF }); powerUpIndicator.anchor.set(0, 0); powerUpIndicator.x = 20; powerUpIndicator.y = 200; LK.gui.topLeft.addChild(powerUpIndicator); function initializeLevel() { cannon = game.addChild(new Cannon()); cannon.x = 1024; cannon.y = 2600; aimLine = game.addChild(new AimLine()); aimLine.x = cannon.x; aimLine.y = cannon.y; aimLine.visible = false; spawnBallRow(); } function spawnBallRow() { var spacing = 2048 / (ballsPerRow + 1); for (var i = 0; i < ballsPerRow; i++) { if (Math.random() < 0.8) { var ball = new Ball(); ball.x = spacing * (i + 1); ball.y = -50; ball.setNumber(Math.floor(Math.random() * stage * 5) + stage); balls.push(ball); game.addChild(ball); if (Math.random() < 0.15) { var powerup = new PowerUp(); powerup.x = ball.x; powerup.y = ball.y; powerups.push(powerup); game.addChild(powerup); } else if (Math.random() < 0.1) { var star = new Star(); star.x = ball.x; star.y = ball.y; stars.push(star); game.addChild(star); } else if (Math.random() < 0.05 && stage > 2) { var slowPowerup = new SlowMotionPowerUp(); slowPowerup.x = ball.x; slowPowerup.y = ball.y; slowMotionPowerups.push(slowPowerup); game.addChild(slowPowerup); } } } } function fireProjectiles(angle) { var shotCount = projectileCount; var delay = 100; if (currentWeapon === 'rapid') { shotCount = Math.min(projectileCount * 3, 15); delay = 30; } for (var i = 0; i < shotCount; i++) { LK.setTimeout(function () { var projectile = new SpecialProjectile(); projectile.x = cannon.x; projectile.y = cannon.y - 40; projectile.setType(currentWeapon); if (currentWeapon === 'rapid') { var spread = (Math.random() - 0.5) * 0.2; projectile.velocityX = Math.cos(angle + spread) * projectile.speed; projectile.velocityY = Math.sin(angle + spread) * projectile.speed; } else { projectile.velocityX = Math.cos(angle) * projectile.speed; projectile.velocityY = Math.sin(angle) * projectile.speed; } projectiles.push(projectile); game.addChild(projectile); LK.getSound('shoot').play(); }, i * delay); } } function checkCollision(obj1, obj2, radius1, radius2) { var dx = obj1.x - obj2.x; var dy = obj1.y - obj2.y; var distance = Math.sqrt(dx * dx + dy * dy); return distance < radius1 + radius2; } function createExplosion(x, y, color, count) { for (var i = 0; i < count; i++) { var particle = new Particle(); particle.x = x; particle.y = y; var angle = Math.random() * Math.PI * 2; var speed = Math.random() * 10 + 5; particle.velocityX = Math.cos(angle) * speed; particle.velocityY = Math.sin(angle) * speed; particle.tint = color; particles.push(particle); game.addChild(particle); } // Create shockwave effect for chain reactions if (chainReactionActive && count > 15) { var shockwave = game.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5, x: x, y: y, scaleX: 0.1, scaleY: 0.1, alpha: 0.8, tint: color }); tween(shockwave, { scaleX: 5, scaleY: 5, alpha: 0 }, { duration: 500, onFinish: function onFinish() { shockwave.destroy(); } }); } // Screen shake for explosive weapons if (currentWeapon === 'explosive' && count > 15) { var shakeAmount = 20; var originalX = game.x; var originalY = game.y; tween(game, { x: originalX + (Math.random() - 0.5) * shakeAmount, y: originalY + (Math.random() - 0.5) * shakeAmount }, { duration: 50, onFinish: function onFinish() { tween(game, { x: originalX + (Math.random() - 0.5) * shakeAmount * 0.5, y: originalY + (Math.random() - 0.5) * shakeAmount * 0.5 }, { duration: 50, onFinish: function onFinish() { tween(game, { x: originalX, y: originalY }, { duration: 50 }); } }); } }); } } function updateCombo() { combo++; comboTimer = 120; // 2 seconds at 60 FPS if (combo >= 5) { scoreMultiplier = Math.min(combo / 5, 5); comboText.setText('COMBO x' + Math.floor(scoreMultiplier)); comboText.alpha = 1; tween(comboText, { scaleX: 1.5, scaleY: 1.5 }, { duration: 200, onFinish: function onFinish() { tween(comboText, { scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); } } function moveRow() { chainReactionActive = false; consecutiveHits = 0; spawnBallRow(); } game.down = function (x, y, obj) { if (!canShoot || !gameActive) return; isAiming = true; aimLine.visible = true; }; game.move = function (x, y, obj) { if (!isAiming || !gameActive) return; var dx = x - cannon.x; var dy = y - cannon.y; var angle = Math.atan2(dy, dx); if (angle > -Math.PI && angle < 0) { cannon.rotation = angle + Math.PI / 2; aimLine.rotation = angle + Math.PI / 2; } }; game.up = function (x, y, obj) { if (!isAiming || !gameActive) return; isAiming = false; aimLine.visible = false; canShoot = false; var dx = x - cannon.x; var dy = y - cannon.y; var angle = Math.atan2(dy, dx); if (angle > -Math.PI && angle < 0) { fireProjectiles(angle); } }; game.update = function () { if (!gameActive) return; // Update slow motion if (slowMotionActive) { slowMotionTimer--; gameSpeed = 0.3; if (slowMotionTimer <= 0) { slowMotionActive = false; gameSpeed = 1; tween(slowMotionBg, { alpha: 0 }, { duration: 300 }); powerUpIndicator.setText(''); } } else { gameSpeed = 1; } // Update magnet effect if (magnetActive) { magnetTimer--; if (magnetTimer <= 0) { magnetActive = false; } } // Update combo timer if (comboTimer > 0) { comboTimer--; if (comboTimer === 0) { combo = 0; scoreMultiplier = 1; consecutiveHits = 0; tween(comboText, { alpha: 0 }, { duration: 300 }); } } // Update particles for (var i = particles.length - 1; i >= 0; i--) { if (particles[i].update()) { particles[i].destroy(); particles.splice(i, 1); } } // Update slow motion powerups for (var i = 0; i < slowMotionPowerups.length; i++) { slowMotionPowerups[i].update(); } // Update ball falling speed for (var i = 0; i < balls.length; i++) { balls[i].y += ballSpeed * gameSpeed; } for (var i = 0; i < powerups.length; i++) { powerups[i].y += ballSpeed * gameSpeed; } for (var i = 0; i < stars.length; i++) { stars[i].y += ballSpeed * gameSpeed; } for (var i = 0; i < slowMotionPowerups.length; i++) { slowMotionPowerups[i].y += ballSpeed * gameSpeed; } // Update projectiles for (var i = projectiles.length - 1; i >= 0; i--) { var projectile = projectiles[i]; // Apply game speed to projectile movement var oldVelX = projectile.velocityX; var oldVelY = projectile.velocityY; projectile.velocityX *= gameSpeed; projectile.velocityY *= gameSpeed; if (projectile.update() || projectile.y > 2732 + 50) { projectile.destroy(); projectiles.splice(i, 1); continue; } projectile.velocityX = oldVelX; projectile.velocityY = oldVelY; // Apply magnet effect if (magnetActive) { var closestBall = null; var closestDist = 200; for (var j = 0; j < balls.length; j++) { var ball = balls[j]; var dx = ball.x - projectile.x; var dy = ball.y - projectile.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist < closestDist) { closestDist = dist; closestBall = ball; } } if (closestBall) { var dx = closestBall.x - projectile.x; var dy = closestBall.y - projectile.y; var dist = Math.sqrt(dx * dx + dy * dy); projectile.velocityX += dx / dist * 2; projectile.velocityY += dy / dist * 2; var speed = Math.sqrt(projectile.velocityX * projectile.velocityX + projectile.velocityY * projectile.velocityY); if (speed > projectile.speed * 1.5) { projectile.velocityX = projectile.velocityX / speed * projectile.speed * 1.5; projectile.velocityY = projectile.velocityY / speed * projectile.speed * 1.5; } } } var hitBall = false; // Check ball collisions for (var j = balls.length - 1; j >= 0; j--) { var ball = balls[j]; if (checkCollision(projectile, ball, projectile.radius, ball.radius)) { LK.getSound('hit').play(); updateCombo(); hitBall = true; // Handle explosive projectiles if (projectile.type === 'explosive') { createExplosion(ball.x, ball.y, 0xff4444, 20); // Damage nearby balls for (var k = balls.length - 1; k >= 0; k--) { var otherBall = balls[k]; if (checkCollision(ball, otherBall, 150, otherBall.radius)) { if (otherBall.takeDamage()) { LK.getSound('destroy').play(); LK.setScore(LK.getScore() + Math.floor(stage * scoreMultiplier)); createExplosion(otherBall.x, otherBall.y, 0xffff00, 10); otherBall.destroy(); balls.splice(k, 1); } } } } if (ball.takeDamage()) { LK.getSound('destroy').play(); consecutiveHits++; if (consecutiveHits >= 3) { chainReactionActive = true; } var points = Math.floor(stage * scoreMultiplier * (chainReactionActive ? 2 : 1)); LK.setScore(LK.getScore() + points); scoreText.setText('Score: ' + LK.getScore()); createExplosion(ball.x, ball.y, 0xffff00, chainReactionActive ? 25 : 15); // Chain reaction damage if (chainReactionActive) { for (var k = balls.length - 1; k >= 0; k--) { var nearbyBall = balls[k]; if (nearbyBall !== ball && checkCollision(ball, nearbyBall, 100, nearbyBall.radius)) { if (nearbyBall.takeDamage()) { LK.getSound('destroy').play(); LK.setScore(LK.getScore() + Math.floor(stage * scoreMultiplier * 2)); createExplosion(nearbyBall.x, nearbyBall.y, 0xffff00, 20); nearbyBall.destroy(); balls.splice(k, 1); } } } } ball.destroy(); balls.splice(j, 1); } // Handle projectile behavior after hit if (projectile.type === 'piercing' && projectile.piercing > 0) { projectile.piercing--; // Continue in same direction } else if (projectile.type === 'explosive') { projectile.destroy(); projectiles.splice(i, 1); i--; break; } else { // Normal bounce var dx = projectile.x - ball.x; var dy = projectile.y - ball.y; var dist = Math.sqrt(dx * dx + dy * dy); dx /= dist; dy /= dist; projectile.velocityX = dx * projectile.speed; projectile.velocityY = dy * projectile.speed; } if (!projectile.type || projectile.type === 'normal' || projectile.type === 'rapid') { break; } } } if (hitBall) continue;else { chainReactionActive = false; consecutiveHits = 0; } // Check powerup collisions for (var j = powerups.length - 1; j >= 0; j--) { var powerup = powerups[j]; if (checkCollision(projectile, powerup, projectile.radius, powerup.radius)) { LK.getSound('collect').play(); projectileCount++; projectileCountText.setText('x' + projectileCount); createExplosion(powerup.x, powerup.y, 0x4ecdc4, 10); powerup.destroy(); powerups.splice(j, 1); } } // Check slow motion power-up collisions for (var j = slowMotionPowerups.length - 1; j >= 0; j--) { var slowPowerup = slowMotionPowerups[j]; if (checkCollision(projectile, slowPowerup, projectile.radius, slowPowerup.radius)) { LK.getSound('collect').play(); slowMotionActive = true; slowMotionTimer = 300; // 5 seconds at 60 FPS powerUpIndicator.setText('SLOW MOTION'); tween(slowMotionBg, { alpha: 0.1 }, { duration: 300 }); createExplosion(slowPowerup.x, slowPowerup.y, 0x9b59b6, 20); slowPowerup.destroy(); slowMotionPowerups.splice(j, 1); } } // Check star collisions for (var j = stars.length - 1; j >= 0; j--) { var star = stars[j]; if (checkCollision(projectile, star, projectile.radius, star.radius)) { LK.getSound('collect').play(); // Random bonus effect var randomEffect = Math.random(); if (randomEffect < 0.3) { magnetActive = true; magnetTimer = 180; // 3 seconds powerUpIndicator.setText('MAGNET ACTIVE'); } else if (randomEffect < 0.6) { projectileCount += 2; projectileCountText.setText('x' + projectileCount); } // Unlock weapons based on score if (LK.getScore() >= 100 && !weaponUnlocks.piercing) { weaponUnlocks.piercing = true; var unlockText = new Text2('Piercing Weapon Unlocked!', { size: 80, fill: 0xFF00FF }); unlockText.anchor.set(0.5, 0.5); unlockText.alpha = 0; LK.gui.center.addChild(unlockText); tween(unlockText, { alpha: 1, y: -100 }, { duration: 500, onFinish: function onFinish() { tween(unlockText, { alpha: 0 }, { duration: 1000, delay: 1000, onFinish: function onFinish() { unlockText.destroy(); } }); } }); } if (LK.getScore() >= 300 && !weaponUnlocks.explosive) { weaponUnlocks.explosive = true; var unlockText = new Text2('Explosive Weapon Unlocked!', { size: 80, fill: 0xFF4444 }); unlockText.anchor.set(0.5, 0.5); unlockText.alpha = 0; LK.gui.center.addChild(unlockText); tween(unlockText, { alpha: 1, y: -100 }, { duration: 500, onFinish: function onFinish() { tween(unlockText, { alpha: 0 }, { duration: 1000, delay: 1000, onFinish: function onFinish() { unlockText.destroy(); } }); } }); } if (LK.getScore() >= 500 && !weaponUnlocks.rapid) { weaponUnlocks.rapid = true; var unlockText = new Text2('Rapid Fire Unlocked!', { size: 80, fill: 0x44FF44 }); unlockText.anchor.set(0.5, 0.5); unlockText.alpha = 0; LK.gui.center.addChild(unlockText); tween(unlockText, { alpha: 1, y: -100 }, { duration: 500, onFinish: function onFinish() { tween(unlockText, { alpha: 0 }, { duration: 1000, delay: 1000, onFinish: function onFinish() { unlockText.destroy(); } }); } }); } LK.setScore(LK.getScore() + Math.floor(10 * scoreMultiplier)); scoreText.setText('Score: ' + LK.getScore()); createExplosion(star.x, star.y, 0xffd93d, 15); star.destroy(); stars.splice(j, 1); } } } // Check if all projectiles are gone if (projectiles.length === 0 && !canShoot) { canShoot = true; moveRow(); if (balls.length === 0) { stage++; stageText.setText('Stage ' + stage); ballSpeed += 0.1; // Bonus for clearing stage var bonus = stage * 50; LK.setScore(LK.getScore() + bonus); scoreText.setText('Score: ' + LK.getScore()); var bonusText = new Text2('Stage Clear! +' + bonus, { size: 100, fill: 0x00FF00 }); bonusText.anchor.set(0.5, 0.5); bonusText.alpha = 0; LK.gui.center.addChild(bonusText); tween(bonusText, { alpha: 1, y: -200 }, { duration: 500, onFinish: function onFinish() { tween(bonusText, { alpha: 0 }, { duration: 500, delay: 500, onFinish: function onFinish() { bonusText.destroy(); } }); } }); } } // Check game over for (var i = 0; i < balls.length; i++) { if (balls[i].y > 2400) { gameActive = false; LK.showGameOver(); break; } } }; // Add weapon switch button var weaponButton = game.addChild(new Container()); var buttonBg = weaponButton.attachAsset('addBallButton', { anchorX: 0.5, anchorY: 0.5 }); weaponButton.x = 1024; weaponButton.y = 2400; weaponButton.down = function () { var weapons = ['normal']; if (weaponUnlocks.piercing) weapons.push('piercing'); if (weaponUnlocks.explosive) weapons.push('explosive'); if (weaponUnlocks.rapid) weapons.push('rapid'); var currentIndex = weapons.indexOf(currentWeapon); currentWeapon = weapons[(currentIndex + 1) % weapons.length]; switch (currentWeapon) { case 'normal': weaponText.setText('Normal'); weaponText.tint = 0xFFFFFF; break; case 'piercing': weaponText.setText('Piercing'); weaponText.tint = 0xFF00FF; break; case 'explosive': weaponText.setText('Explosive'); weaponText.tint = 0xFF4444; break; case 'rapid': weaponText.setText('Rapid Fire'); weaponText.tint = 0x44FF44; break; } tween(weaponButton, { scaleX: 1.2, scaleY: 1.2 }, { duration: 100, onFinish: function onFinish() { tween(weaponButton, { scaleX: 1, scaleY: 1 }, { duration: 100 }); } }); }; initializeLevel();
===================================================================
--- original.js
+++ change.js
@@ -132,8 +132,24 @@
}
};
return self;
});
+var SlowMotionPowerUp = Container.expand(function () {
+ var self = Container.call(this);
+ var powerupGraphics = self.attachAsset('powerup', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ tint: 0x9b59b6
+ });
+ self.radius = 30;
+ self.pulseTimer = 0;
+ self.update = function () {
+ self.pulseTimer += 0.1;
+ var scale = 1 + Math.sin(self.pulseTimer) * 0.2;
+ powerupGraphics.scale.set(scale);
+ };
+ return self;
+});
var SpecialProjectile = Container.expand(function () {
var self = Container.call(this);
self.type = 'normal';
self.velocityX = 0;
@@ -283,15 +299,43 @@
piercing: false,
explosive: false,
rapid: false
};
+var slowMotionActive = false;
+var slowMotionTimer = 0;
+var gameSpeed = 1;
+var magnetActive = false;
+var magnetTimer = 0;
+var specialEffects = [];
+var chainReactionActive = false;
+var lastBallDestroyed = null;
+var consecutiveHits = 0;
+var slowMotionPowerups = [];
var weaponText = new Text2('Normal', {
size: 40,
fill: 0xFFFFFF
});
weaponText.anchor.set(0.5, 1);
weaponText.y = -20;
LK.gui.bottom.addChild(weaponText);
+var slowMotionOverlay = new Container();
+var slowMotionBg = slowMotionOverlay.attachAsset('ball', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 50,
+ scaleY: 50,
+ alpha: 0,
+ tint: 0x9b59b6
+});
+LK.gui.center.addChild(slowMotionOverlay);
+var powerUpIndicator = new Text2('', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+powerUpIndicator.anchor.set(0, 0);
+powerUpIndicator.x = 20;
+powerUpIndicator.y = 200;
+LK.gui.topLeft.addChild(powerUpIndicator);
function initializeLevel() {
cannon = game.addChild(new Cannon());
cannon.x = 1024;
cannon.y = 2600;
@@ -322,8 +366,14 @@
star.x = ball.x;
star.y = ball.y;
stars.push(star);
game.addChild(star);
+ } else if (Math.random() < 0.05 && stage > 2) {
+ var slowPowerup = new SlowMotionPowerUp();
+ slowPowerup.x = ball.x;
+ slowPowerup.y = ball.y;
+ slowMotionPowerups.push(slowPowerup);
+ game.addChild(slowPowerup);
}
}
}
}
@@ -372,8 +422,31 @@
particle.tint = color;
particles.push(particle);
game.addChild(particle);
}
+ // Create shockwave effect for chain reactions
+ if (chainReactionActive && count > 15) {
+ var shockwave = game.attachAsset('ball', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: x,
+ y: y,
+ scaleX: 0.1,
+ scaleY: 0.1,
+ alpha: 0.8,
+ tint: color
+ });
+ tween(shockwave, {
+ scaleX: 5,
+ scaleY: 5,
+ alpha: 0
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ shockwave.destroy();
+ }
+ });
+ }
// Screen shake for explosive weapons
if (currentWeapon === 'explosive' && count > 15) {
var shakeAmount = 20;
var originalX = game.x;
@@ -425,17 +498,10 @@
});
}
}
function moveRow() {
- for (var i = 0; i < balls.length; i++) {
- balls[i].y += 100;
- }
- for (var i = 0; i < powerups.length; i++) {
- powerups[i].y += 100;
- }
- for (var i = 0; i < stars.length; i++) {
- stars[i].y += 100;
- }
+ chainReactionActive = false;
+ consecutiveHits = 0;
spawnBallRow();
}
game.down = function (x, y, obj) {
if (!canShoot || !gameActive) return;
@@ -465,14 +531,39 @@
}
};
game.update = function () {
if (!gameActive) return;
+ // Update slow motion
+ if (slowMotionActive) {
+ slowMotionTimer--;
+ gameSpeed = 0.3;
+ if (slowMotionTimer <= 0) {
+ slowMotionActive = false;
+ gameSpeed = 1;
+ tween(slowMotionBg, {
+ alpha: 0
+ }, {
+ duration: 300
+ });
+ powerUpIndicator.setText('');
+ }
+ } else {
+ gameSpeed = 1;
+ }
+ // Update magnet effect
+ if (magnetActive) {
+ magnetTimer--;
+ if (magnetTimer <= 0) {
+ magnetActive = false;
+ }
+ }
// Update combo timer
if (comboTimer > 0) {
comboTimer--;
if (comboTimer === 0) {
combo = 0;
scoreMultiplier = 1;
+ consecutiveHits = 0;
tween(comboText, {
alpha: 0
}, {
duration: 300
@@ -485,16 +576,67 @@
particles[i].destroy();
particles.splice(i, 1);
}
}
+ // Update slow motion powerups
+ for (var i = 0; i < slowMotionPowerups.length; i++) {
+ slowMotionPowerups[i].update();
+ }
+ // Update ball falling speed
+ for (var i = 0; i < balls.length; i++) {
+ balls[i].y += ballSpeed * gameSpeed;
+ }
+ for (var i = 0; i < powerups.length; i++) {
+ powerups[i].y += ballSpeed * gameSpeed;
+ }
+ for (var i = 0; i < stars.length; i++) {
+ stars[i].y += ballSpeed * gameSpeed;
+ }
+ for (var i = 0; i < slowMotionPowerups.length; i++) {
+ slowMotionPowerups[i].y += ballSpeed * gameSpeed;
+ }
// Update projectiles
for (var i = projectiles.length - 1; i >= 0; i--) {
var projectile = projectiles[i];
+ // Apply game speed to projectile movement
+ var oldVelX = projectile.velocityX;
+ var oldVelY = projectile.velocityY;
+ projectile.velocityX *= gameSpeed;
+ projectile.velocityY *= gameSpeed;
if (projectile.update() || projectile.y > 2732 + 50) {
projectile.destroy();
projectiles.splice(i, 1);
continue;
}
+ projectile.velocityX = oldVelX;
+ projectile.velocityY = oldVelY;
+ // Apply magnet effect
+ if (magnetActive) {
+ var closestBall = null;
+ var closestDist = 200;
+ for (var j = 0; j < balls.length; j++) {
+ var ball = balls[j];
+ var dx = ball.x - projectile.x;
+ var dy = ball.y - projectile.y;
+ var dist = Math.sqrt(dx * dx + dy * dy);
+ if (dist < closestDist) {
+ closestDist = dist;
+ closestBall = ball;
+ }
+ }
+ if (closestBall) {
+ var dx = closestBall.x - projectile.x;
+ var dy = closestBall.y - projectile.y;
+ var dist = Math.sqrt(dx * dx + dy * dy);
+ projectile.velocityX += dx / dist * 2;
+ projectile.velocityY += dy / dist * 2;
+ var speed = Math.sqrt(projectile.velocityX * projectile.velocityX + projectile.velocityY * projectile.velocityY);
+ if (speed > projectile.speed * 1.5) {
+ projectile.velocityX = projectile.velocityX / speed * projectile.speed * 1.5;
+ projectile.velocityY = projectile.velocityY / speed * projectile.speed * 1.5;
+ }
+ }
+ }
var hitBall = false;
// Check ball collisions
for (var j = balls.length - 1; j >= 0; j--) {
var ball = balls[j];
@@ -520,11 +662,31 @@
}
}
if (ball.takeDamage()) {
LK.getSound('destroy').play();
- LK.setScore(LK.getScore() + Math.floor(stage * scoreMultiplier));
+ consecutiveHits++;
+ if (consecutiveHits >= 3) {
+ chainReactionActive = true;
+ }
+ var points = Math.floor(stage * scoreMultiplier * (chainReactionActive ? 2 : 1));
+ LK.setScore(LK.getScore() + points);
scoreText.setText('Score: ' + LK.getScore());
- createExplosion(ball.x, ball.y, 0xffff00, 15);
+ createExplosion(ball.x, ball.y, 0xffff00, chainReactionActive ? 25 : 15);
+ // Chain reaction damage
+ if (chainReactionActive) {
+ for (var k = balls.length - 1; k >= 0; k--) {
+ var nearbyBall = balls[k];
+ if (nearbyBall !== ball && checkCollision(ball, nearbyBall, 100, nearbyBall.radius)) {
+ if (nearbyBall.takeDamage()) {
+ LK.getSound('destroy').play();
+ LK.setScore(LK.getScore() + Math.floor(stage * scoreMultiplier * 2));
+ createExplosion(nearbyBall.x, nearbyBall.y, 0xffff00, 20);
+ nearbyBall.destroy();
+ balls.splice(k, 1);
+ }
+ }
+ }
+ }
ball.destroy();
balls.splice(j, 1);
}
// Handle projectile behavior after hit
@@ -550,9 +712,12 @@
break;
}
}
}
- if (hitBall) continue;
+ if (hitBall) continue;else {
+ chainReactionActive = false;
+ consecutiveHits = 0;
+ }
// Check powerup collisions
for (var j = powerups.length - 1; j >= 0; j--) {
var powerup = powerups[j];
if (checkCollision(projectile, powerup, projectile.radius, powerup.radius)) {
@@ -563,13 +728,41 @@
powerup.destroy();
powerups.splice(j, 1);
}
}
+ // Check slow motion power-up collisions
+ for (var j = slowMotionPowerups.length - 1; j >= 0; j--) {
+ var slowPowerup = slowMotionPowerups[j];
+ if (checkCollision(projectile, slowPowerup, projectile.radius, slowPowerup.radius)) {
+ LK.getSound('collect').play();
+ slowMotionActive = true;
+ slowMotionTimer = 300; // 5 seconds at 60 FPS
+ powerUpIndicator.setText('SLOW MOTION');
+ tween(slowMotionBg, {
+ alpha: 0.1
+ }, {
+ duration: 300
+ });
+ createExplosion(slowPowerup.x, slowPowerup.y, 0x9b59b6, 20);
+ slowPowerup.destroy();
+ slowMotionPowerups.splice(j, 1);
+ }
+ }
// Check star collisions
for (var j = stars.length - 1; j >= 0; j--) {
var star = stars[j];
if (checkCollision(projectile, star, projectile.radius, star.radius)) {
LK.getSound('collect').play();
+ // Random bonus effect
+ var randomEffect = Math.random();
+ if (randomEffect < 0.3) {
+ magnetActive = true;
+ magnetTimer = 180; // 3 seconds
+ powerUpIndicator.setText('MAGNET ACTIVE');
+ } else if (randomEffect < 0.6) {
+ projectileCount += 2;
+ projectileCountText.setText('x' + projectileCount);
+ }
// Unlock weapons based on score
if (LK.getScore() >= 100 && !weaponUnlocks.piercing) {
weaponUnlocks.piercing = true;
var unlockText = new Text2('Piercing Weapon Unlocked!', {
Renkli yuvarlak Balon, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. High contrast. No shadows
tek renk top, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. 2d. High contrast. No shadows
tek renk top, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. High contrast. No shadows
tek renk top, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. High contrast. No shadows
tek renk top, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. High contrast. No shadows
tek renk top, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. High contrast. No shadows
tek renk top, üstten görünüm, Gerçekçi, yazısız.. In-Game asset. High contrast. No shadows