User prompt
Müziği oyun başlayınca direk başlat bitincede tekrarla
User prompt
Arka plandaki müziği bir top vurunca baslat
User prompt
Müziği çalıştır
User prompt
Her ne varsa hepsini optimize et bozuk olan birşey olmasın
User prompt
Arka plandaki müziği çal.
User prompt
Oyunun dosyalarında arka planda çalacak şarkıyı çaldır ve optimize et
User prompt
Oyunun herseyini optimize et ve eklediğim müziği oyun oynarken arkada çalışsın
User prompt
Oyunun herseyini optimize et ve eklediğim müziği oyun oynarken arkada çalsın.
User prompt
Oyun başlar başlamaz arka plandaki şarkıyı çaldır ve bitince tekrarla
User prompt
Oyuna mevcut arkada çalan şarkıyı ekle
User prompt
Oyunun herseyini optimize et ve eklediğim müziği oyun oynarken arkada çalsın.
User prompt
Oyunun herseyini optimize et ve eklediğim müziği oyun oynarken arkada çalsın.
User prompt
Herşeyi optimize et ve eklediğim müziği oyun oynarken arkada çalsın.
User prompt
Şuan mevcut olan arka plandaki şarkıyı sil
User prompt
Oyunun herseyini optimize et ve eklediğim müziği oyun oynarken arkada çalsın.
User prompt
Oyunun herseyini optimize et ve eklediğim müziği oyun oynarken arkada çalsın.
User prompt
Oyunun herseyini optimize et
User prompt
Sesler yok geliyor oyunu optimize et ve düzelt
User prompt
Ekledigim sesleri oyunda aktif et
User prompt
Top vurma sesi için dosya ekle
User prompt
Oyun arka planda çalan ses için dosya ekle
User prompt
Rank fotograflarina altına mevcut puanına göre rankın seviyeleri ve fotoğraf yanlarına ateş efekti ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Toplar düşerken efeck olmasın ve topların puan canı artık 30 olsun bombada -10 puan eksilmesin
User prompt
Oyunu optimize et
User prompt
Please fix the bug: 'ReferenceError: effectColor is not defined' in or related to this line: 'var explosionColor = effectColor || 0xFFFFFF;' Line Number: 144
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Arrow = Container.expand(function (targetX, targetY, startX, startY) {
var self = Container.call(this);
// Attach arrow asset
var arrowGraphics = self.attachAsset('arrow', {
anchorX: 0.5,
anchorY: 0.5
});
// Calculate direction and speed
var dx = targetX - startX;
var dy = targetY - startY;
var distance = Math.sqrt(dx * dx + dy * dy);
// Set base speed and apply power-up multiplier
var baseSpeed = 8;
var speed = baseSpeed;
if (extraPowerActive) speed *= 1.8;
if (speedBoostActive) speed *= 1.5;
// Cache velocity calculations
var velocityMultiplier = speed / distance;
self.velocityX = dx * velocityMultiplier;
self.velocityY = dy * velocityMultiplier;
// Set rotation to point toward target
arrowGraphics.rotation = Math.atan2(dy, dx);
self.update = function () {
self.x += self.velocityX;
self.y += self.velocityY;
// Remove arrow if it goes off screen (check this first for early exit)
if (self.x < -100 || self.x > 2148 || self.y < -100 || self.y > 2832) {
self.destroy();
return;
}
// Check collision with balls (optimized)
for (var i = balls.length - 1; i >= 0; i--) {
var ball = balls[i];
// Quick distance check before expensive intersection test
var dx = self.x - ball.x;
var dy = self.y - ball.y;
var distanceSquared = dx * dx + dy * dy;
if (distanceSquared < 7500) {
// 86px collision range - tighter check
if (self.intersects(ball)) {
// Trigger ball hit
ball.hit();
self.destroy();
return;
}
}
}
// Check collision with bombs (optimized)
for (var j = bombs.length - 1; j >= 0; j--) {
var bomb = bombs[j];
// Quick distance check before expensive intersection test
var dx2 = self.x - bomb.x;
var dy2 = self.y - bomb.y;
var distanceSquared2 = dx2 * dx2 + dy2 * dy2;
if (distanceSquared2 < 7500) {
// 86px collision range - tighter check
if (self.intersects(bomb)) {
// Trigger bomb hit
bomb.hit();
self.destroy();
return;
}
}
}
};
return self;
});
var Ball = Container.expand(function (ballType) {
var self = Container.call(this);
// Store ball type and set properties based on type
self.ballType = ballType;
var assetId, points;
switch (ballType) {
case 'red':
assetId = 'redBall';
points = 30;
break;
case 'yellow':
assetId = 'yellowBall';
points = 30;
break;
case 'blue':
assetId = 'blueBall';
points = 30;
break;
}
self.points = points;
// Attach the appropriate ball asset
var ballGraphics = self.attachAsset(assetId, {
anchorX: 0.5,
anchorY: 0.5
});
// Add floating animation
self.floatDirection = Math.random() > 0.5 ? 1 : -1;
self.floatSpeed = 0.5 + Math.random() * 0.5;
self.floatOffset = 0;
// Add horizontal movement
self.horizontalDirection = Math.random() > 0.5 ? 1 : -1;
self.horizontalSpeed = 4 + Math.random() * 3;
// Add vertical movement
self.verticalDirection = Math.random() > 0.5 ? 1 : -1;
self.verticalSpeed = 1.5 + Math.random() * 2;
// Initialize falling properties
self.isHit = false;
self.isFalling = false;
self.fallSpeed = 0;
self.gravity = 0.5;
self.update = function () {
// If ball is falling after being hit, apply gravity
if (self.isFalling) {
self.fallSpeed += self.gravity;
self.y += self.fallSpeed;
// Check if ball hits the ground (bottom of screen)
if (self.y >= 2600) {
// Simply destroy the ball without effects
self.destroy();
return;
}
} else {
// Normal ball movement when not hit
// Only update floating animation every few frames to reduce CPU load
if (LK.ticks % 6 === 0) {
self.floatOffset += self.floatSpeed;
self.y += Math.sin(self.floatOffset) * self.floatDirection * 0.3;
}
// Add horizontal movement in both directions
self.x += self.horizontalSpeed * self.horizontalDirection;
// Add vertical movement for diagonal motion
self.y += self.verticalSpeed * self.verticalDirection;
// Keep balls in upper area - restrict Y position for portrait screen
if (self.y > 1800) {
self.y = 1800;
self.verticalDirection = -1; // Bounce upward
}
if (self.y < 100) {
self.y = 100;
self.verticalDirection = 1; // Bounce downward
}
// Bounce off screen edges - keep balls in central area for portrait screen
if (self.x <= 200 || self.x >= 1848) {
self.horizontalDirection *= -1; // Reverse horizontal direction
if (self.x <= 200) self.x = 200;
if (self.x >= 1848) self.x = 1848;
}
}
};
self.hit = function () {
// Award points and remove ball
var basePoints = self.points;
var finalPoints = basePoints;
// Apply extra power bonus if active
if (extraPowerActive) {
finalPoints += 30;
}
var oldScore = LK.getScore();
LK.setScore(oldScore + finalPoints);
scoreTxt.setText(LK.getScore());
// Add colorful effect to score based on ball type
var effectColor;
switch (self.ballType) {
case 'red':
effectColor = 0xFF4444;
break;
case 'yellow':
effectColor = 0xFFFF44;
break;
case 'blue':
effectColor = 0x4444FF;
break;
}
// Stop any existing tween on score text
tween.stop(scoreTxt, {
tint: true,
scaleX: true,
scaleY: true
});
// Apply color tint effect
tween(scoreTxt, {
tint: effectColor
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
// Fade back to white
tween(scoreTxt, {
tint: 0xFFFFFF
}, {
duration: 500,
easing: tween.easeInOut
});
}
});
// Add scale pulse effect
scoreTxt.scaleX = 1.3;
scoreTxt.scaleY = 1.3;
tween(scoreTxt, {
scaleX: 1,
scaleY: 1
}, {
duration: 400,
easing: tween.bounceOut
});
updateRankDisplay();
LK.getSound('pop').play();
// Check for extra life every 5000 points
var newScore = LK.getScore();
var oldLifeBonuses = Math.floor(oldScore / 5000);
var newLifeBonuses = Math.floor(newScore / 5000);
if (newLifeBonuses > oldLifeBonuses) {
lives++;
updateHeartsDisplay();
LK.effects.flashScreen(0x00FF00, 800); // Green flash for extra life
}
// Check for arrow speed boost every 10000 points
var oldSpeedBonuses = Math.floor(oldScore / 10000);
var newSpeedBonuses = Math.floor(newScore / 10000);
if (newSpeedBonuses > oldSpeedBonuses) {
// Activate speed boost for 1 minute
speedBoostActive = true;
speedBoostEndTime = remainingTime - 60; // 1 minute duration
LK.effects.flashScreen(0x0080FF, 800); // Blue flash for speed boost
}
// 1% chance to gain extra life on ball hit
if (Math.random() < 0.01) {
lives++;
updateHeartsDisplay();
LK.effects.flashScreen(0x00FF00, 800); // Green flash for extra life
}
// 6% chance to activate power-up
if (Math.random() < 0.06) {
// 50% chance for each power-up type
if (Math.random() < 0.5) {
// Activate extra power (+30 points)
extraPowerActive = true;
extraPowerEndTime = remainingTime - powerUpDuration;
} else {
// Activate dual shot
dualShotActive = true;
dualShotEndTime = remainingTime - powerUpDuration;
}
}
// Mark ball as hit and start falling
self.isHit = true;
self.isFalling = true;
self.fallSpeed = 0;
self.gravity = 0.5;
// Remove from balls array
for (var i = balls.length - 1; i >= 0; i--) {
if (balls[i] === self) {
balls.splice(i, 1);
break;
}
}
// Spawn a new random ball at a random position for portrait screen
var randomBallType = ballTypes[Math.floor(Math.random() * ballTypes.length)];
var newBall = new Ball(randomBallType);
// Random position in the game area (avoiding edges) for portrait screen
newBall.x = 300 + Math.random() * 1448;
newBall.y = 300 + Math.random() * 1200;
balls.push(newBall);
game.addChild(newBall);
};
return self;
});
var Bomb = Container.expand(function () {
var self = Container.call(this);
// Attach bomb asset
var bombGraphics = self.attachAsset('bomb', {
anchorX: 0.5,
anchorY: 0.5
});
// Add pulsing animation to make it look dangerous
self.pulseOffset = Math.random() * Math.PI * 2;
// Add horizontal movement
self.horizontalDirection = Math.random() > 0.5 ? 1 : -1;
self.horizontalSpeed = 4 + Math.random() * 3;
// Add vertical movement
self.verticalDirection = Math.random() > 0.5 ? 1 : -1;
self.verticalSpeed = 1.5 + Math.random() * 2;
self.update = function () {
// Only update pulsing animation every few frames to reduce CPU load
if (LK.ticks % 4 === 0) {
self.pulseOffset += 0.1;
var scale = 1 + Math.sin(self.pulseOffset) * 0.1;
bombGraphics.scaleX = scale;
bombGraphics.scaleY = scale;
}
// Add horizontal movement in both directions
self.x += self.horizontalSpeed * self.horizontalDirection;
// Add vertical movement for diagonal motion
self.y += self.verticalSpeed * self.verticalDirection;
// Keep bombs in upper area - restrict Y position for portrait screen
if (self.y > 1800) {
self.y = 1800;
self.verticalDirection = -1; // Bounce upward
}
if (self.y < 100) {
self.y = 100;
self.verticalDirection = 1; // Bounce downward
}
// Bounce off screen edges - keep bombs in central area for portrait screen
if (self.x <= 200 || self.x >= 1848) {
self.horizontalDirection *= -1; // Reverse horizontal direction
if (self.x <= 200) self.x = 200;
if (self.x >= 1848) self.x = 1848;
}
};
self.hit = function () {
// Play bomb sound effect
LK.getSound('bombSound').play();
// Deduct points and lose a life for hitting bomb
LK.setScore(Math.max(0, LK.getScore() - 10));
scoreTxt.setText(LK.getScore());
updateRankDisplay();
lives--;
updateHeartsDisplay();
bombHitCount++;
// Flash screen red to indicate penalty
LK.effects.flashScreen(0xff0000, 500);
// Check if 5 bombs hit - restart game
if (bombHitCount >= 5) {
LK.showGameOver();
return;
}
// Check game over
if (lives <= 0) {
LK.showGameOver();
return;
}
// Remove from bombs array
for (var i = bombs.length - 1; i >= 0; i--) {
if (bombs[i] === self) {
bombs.splice(i, 1);
break;
}
}
self.destroy();
};
return self;
});
/****
* Initialize Game
****/
// Game arrays to track objects
var game = new LK.Game({
backgroundColor: 0x0080FF
});
/****
* Game Code
****/
// Game arrays to track objects
// Initialize ball assets with different colors
var balls = [];
var bombs = [];
var lives = 5;
var hearts = [];
var bombHitCount = 0;
// Timer variables (30 minutes = 1800 seconds)
var totalGameTime = 1800; // 30 minutes in seconds
var remainingTime = totalGameTime;
var lastSecondTick = 0;
// Power-up system variables
var extraPowerActive = false;
var dualShotActive = false;
var speedBoostActive = false;
var extraPowerEndTime = 0;
var dualShotEndTime = 0;
var speedBoostEndTime = 0;
var powerUpDuration = 180; // 3 minutes in seconds
// CS2 Rank System - 3 Categories
var rankThresholds = [{
name: 'Gümüş Seviyeler',
min: 0,
max: 4910,
color: 0x808080,
asset: 'rankSilver'
}, {
name: 'Altın Nova Seviyeler',
min: 4911,
max: 9734,
color: 0xFFD700,
asset: 'rankGoldNova'
}, {
name: 'Supreme Seviyeler',
min: 9735,
max: 999999,
color: 0xFF0000,
asset: 'rankSupreme'
}];
var currentRank = rankThresholds[0];
var rankIcon = null;
var rankNameTxt = null;
// Score display
var scoreTxt = new Text2('0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(1, 0);
scoreTxt.x = -20;
scoreTxt.y = 20;
LK.gui.topRight.addChild(scoreTxt);
// Timer display
var timerTxt = new Text2('30:00', {
size: 80,
fill: 0xFFFFFF
});
timerTxt.anchor.set(0.5, 0);
timerTxt.x = 0;
timerTxt.y = 20;
LK.gui.top.addChild(timerTxt);
// Power-up display texts
var extraPowerTxt = new Text2('', {
size: 50,
fill: 0x00FF00
});
extraPowerTxt.anchor.set(1, 0);
extraPowerTxt.x = -20;
extraPowerTxt.y = 120;
LK.gui.topRight.addChild(extraPowerTxt);
var dualShotTxt = new Text2('', {
size: 50,
fill: 0x00FFFF
});
dualShotTxt.anchor.set(1, 0);
dualShotTxt.x = -20;
dualShotTxt.y = 180;
LK.gui.topRight.addChild(dualShotTxt);
var speedBoostTxt = new Text2('', {
size: 50,
fill: 0x0080FF
});
speedBoostTxt.anchor.set(1, 0);
speedBoostTxt.x = -20;
speedBoostTxt.y = 240;
LK.gui.topRight.addChild(speedBoostTxt);
// Initialize rank display in bottom left corner
rankNameTxt = new Text2('', {
size: 40,
fill: 0xFFFFFF
});
rankNameTxt.anchor.set(0, 1);
rankNameTxt.x = 540;
rankNameTxt.y = 2712;
game.addChild(rankNameTxt);
// Initialize rank display
updateRankDisplay();
// Function to get current rank based on score
function getCurrentRank(score) {
for (var i = rankThresholds.length - 1; i >= 0; i--) {
if (score >= rankThresholds[i].min) {
return rankThresholds[i];
}
}
return rankThresholds[0];
}
// Function to update rank display
function updateRankDisplay() {
var newRank = getCurrentRank(LK.getScore());
// Always update rank display to ensure it's visible
currentRank = newRank;
// Remove old rank icon if exists
if (rankIcon) {
rankIcon.destroy();
}
// Create new rank icon in bottom left corner
rankIcon = LK.getAsset(currentRank.asset, {
anchorX: 0,
anchorY: 1
});
rankIcon.x = 20;
rankIcon.y = 2712;
game.addChild(rankIcon);
// Update rank name text
if (rankNameTxt) {
rankNameTxt.setText(currentRank.name);
rankNameTxt.tint = currentRank.color;
}
// Flash screen with rank color when rank changes (except first time)
if (LK.getScore() > 0) {
LK.effects.flashScreen(currentRank.color, 1000);
}
}
// Initialize hearts display
function updateHeartsDisplay() {
// Clear existing hearts
for (var h = 0; h < hearts.length; h++) {
hearts[h].destroy();
}
hearts = [];
// Create new hearts based on current lives
for (var i = 0; i < lives; i++) {
var heart = LK.getAsset('heart', {
anchorX: 0.5,
anchorY: 0.5
});
heart.x = -120 - i * 70;
heart.y = -120;
LK.gui.bottomRight.addChild(heart);
hearts.push(heart);
}
}
// Initialize hearts display
updateHeartsDisplay();
// Ball types for spawning
var ballTypes = ['red', 'yellow', 'blue'];
// Create initial grid of balls and bombs arranged for portrait layout
var currentX = 200;
var currentY = 150;
var itemsPerRow = 10;
var spacing = 150;
var itemCount = 0;
// Create equal amounts of balls and bombs in a grid
for (var row = 0; row < 10; row++) {
for (var col = 0; col < itemsPerRow; col++) {
var x = currentX + col * spacing;
var y = currentY + row * spacing;
if (itemCount % 6 === 5) {
// Every 6th item is a bomb
var bomb = new Bomb();
bomb.x = x;
bomb.y = y;
bombs.push(bomb);
game.addChild(bomb);
} else {
// Create balls in sequence: red, yellow, blue
var ballType = ballTypes[itemCount % 3];
var ball = new Ball(ballType);
ball.x = x;
ball.y = y;
balls.push(ball);
game.addChild(ball);
}
itemCount++;
}
}
// Create hand launcher at bottom center
var hand = game.addChild(LK.getAsset('hand', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 1.5
}));
hand.x = 1024;
hand.y = 2400;
var isDragging = false;
var dragStartX = 0;
var dragStartY = 0;
game.down = function (x, y, obj) {
// Check if touch is near the hand
var distance = Math.sqrt((x - hand.x) * (x - hand.x) + (y - hand.y) * (y - hand.y));
if (distance < 100) {
isDragging = true;
dragStartX = x;
dragStartY = y;
}
};
game.move = function (x, y, obj) {
if (isDragging) {
// Move hand slightly toward drag direction
var dx = x - dragStartX;
var dy = y - dragStartY;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 10) {
// Limit movement to 3 steps (90 pixels) from center
var maxDistance = 90;
var targetX = 1024 + dx * 0.3;
var targetY = 2400 + dy * 0.3;
var distanceFromCenter = Math.sqrt((targetX - 1024) * (targetX - 1024) + (targetY - 2400) * (targetY - 2400));
if (distanceFromCenter > maxDistance) {
var ratio = maxDistance / distanceFromCenter;
targetX = 1024 + (targetX - 1024) * ratio;
targetY = 2400 + (targetY - 2400) * ratio;
}
hand.x = targetX;
hand.y = targetY;
// Calculate rotation angle based on drag direction
var targetRotation = Math.atan2(dy, dx);
// Smooth rotation using tween
tween.stop(hand, {
rotation: true
});
tween(hand, {
rotation: targetRotation
}, {
duration: 200,
easing: tween.easeOut
});
}
}
};
game.up = function (x, y, obj) {
if (isDragging) {
// Calculate launch direction (upward from hand position)
var dx = x - hand.x;
var dy = y - hand.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 20) {
// Create and launch arrow toward touch point
var arrow = new Arrow(x, y, hand.x, hand.y);
arrow.x = hand.x;
arrow.y = hand.y;
game.addChild(arrow);
// If dual shot is active, create a second arrow with slight offset
if (dualShotActive) {
var arrow2 = new Arrow(x + 50, y, hand.x, hand.y);
arrow2.x = hand.x;
arrow2.y = hand.y;
game.addChild(arrow2);
}
}
// Reset hand position and rotation
hand.x = 1024;
hand.y = 2400;
// Smooth rotation back to neutral position
tween.stop(hand, {
rotation: true
});
tween(hand, {
rotation: 0
}, {
duration: 300,
easing: tween.easeOut
});
isDragging = false;
}
};
// Play background music
LK.playMusic('J');
game.update = function () {
// Timer logic - update every second (60 ticks = 1 second at 60 FPS)
if (LK.ticks - lastSecondTick >= 60) {
remainingTime--;
lastSecondTick = LK.ticks;
// Format and display time as MM:SS
var minutes = Math.floor(remainingTime / 60);
var seconds = remainingTime % 60;
var timeString = minutes + ':' + (seconds < 10 ? '0' : '') + seconds;
timerTxt.setText(timeString);
// Check if time is up
if (remainingTime <= 0) {
LK.showYouWin(); // Player survives 30 minutes = win condition
return;
}
// Change timer color when less than 5 minutes remain (warning)
if (remainingTime <= 300) {
// 5 minutes = 300 seconds
timerTxt.tint = 0xFF0000; // Red color for urgency
} else if (remainingTime <= 600) {
// 10 minutes = 600 seconds
timerTxt.tint = 0xFFFF00; // Yellow color for caution
}
}
// Check and update power-up timers
if (extraPowerActive && remainingTime <= extraPowerEndTime) {
extraPowerActive = false;
extraPowerTxt.setText('');
}
if (dualShotActive && remainingTime <= dualShotEndTime) {
dualShotActive = false;
dualShotTxt.setText('');
}
if (speedBoostActive && remainingTime <= speedBoostEndTime) {
speedBoostActive = false;
speedBoostTxt.setText('');
}
// Update power-up display texts only when needed
if (extraPowerActive) {
var extraTimeLeft = extraPowerEndTime - remainingTime;
var extraMinutes = Math.floor(Math.abs(extraTimeLeft) / 60);
var extraSeconds = Math.abs(extraTimeLeft) % 60;
var extraTimeString = extraMinutes + ':' + (extraSeconds < 10 ? '0' : '') + extraSeconds;
extraPowerTxt.setText('Güç +30: ' + extraTimeString);
}
if (dualShotActive) {
var dualTimeLeft = dualShotEndTime - remainingTime;
var dualMinutes = Math.floor(Math.abs(dualTimeLeft) / 60);
var dualSeconds = Math.abs(dualTimeLeft) % 60;
var dualTimeString = dualMinutes + ':' + (dualSeconds < 10 ? '0' : '') + dualSeconds;
dualShotTxt.setText('Çift Ok: ' + dualTimeString);
}
if (speedBoostActive) {
var speedTimeLeft = speedBoostEndTime - remainingTime;
var speedMinutes = Math.floor(Math.abs(speedTimeLeft) / 60);
var speedSeconds = Math.abs(speedTimeLeft) % 60;
var speedTimeString = speedMinutes + ':' + (speedSeconds < 10 ? '0' : '') + speedSeconds;
speedBoostTxt.setText('Hız Artışı: ' + speedTimeString);
}
// Score is updated only when it changes in Ball.hit() and Bomb.hit()
// No need for redundant updates here
}; ===================================================================
--- original.js
+++ change.js
@@ -80,17 +80,17 @@
var assetId, points;
switch (ballType) {
case 'red':
assetId = 'redBall';
- points = 40;
+ points = 30;
break;
case 'yellow':
assetId = 'yellowBall';
- points = 60;
+ points = 30;
break;
case 'blue':
assetId = 'blueBall';
- points = 70;
+ points = 30;
break;
}
self.points = points;
// Attach the appropriate ball asset
@@ -119,45 +119,10 @@
self.fallSpeed += self.gravity;
self.y += self.fallSpeed;
// Check if ball hits the ground (bottom of screen)
if (self.y >= 2600) {
- // Create explosion effect at ground position - define effectColor based on ball type
- var effectColor;
- switch (self.ballType) {
- case 'red':
- effectColor = 0xFF4444;
- break;
- case 'yellow':
- effectColor = 0xFFFF44;
- break;
- case 'blue':
- effectColor = 0x4444FF;
- break;
- }
- var explosionColor = effectColor || 0xFFFFFF;
- // Flash screen with ball color for explosion effect
- LK.effects.flashScreen(explosionColor, 300);
- // Create explosion particles using tween effects on the ball itself
- var originalScale = 1;
- // Scale up quickly for explosion effect
- tween(self, {
- scaleX: 2.5,
- scaleY: 2.5,
- alpha: 0
- }, {
- duration: 400,
- easing: tween.easeOut,
- onFinish: function onFinish() {
- self.destroy();
- }
- });
- // Add some visual flair with color flashing
- tween(self, {
- tint: 0xFFFFFF
- }, {
- duration: 200,
- easing: tween.easeOut
- });
+ // Simply destroy the ball without effects
+ self.destroy();
return;
}
} else {
// Normal ball movement when not hit
@@ -351,9 +316,9 @@
self.hit = function () {
// Play bomb sound effect
LK.getSound('bombSound').play();
// Deduct points and lose a life for hitting bomb
- LK.setScore(Math.max(0, LK.getScore() - 30));
+ LK.setScore(Math.max(0, LK.getScore() - 10));
scoreTxt.setText(LK.getScore());
updateRankDisplay();
lives--;
updateHeartsDisplay();