User prompt
tamam hell modundaki her düşen pakete bak %20 ihtimalle belirli paketler seç. bu seçtiğin paketlerde rasgele 2. bir paket daha atsın 0.05 saniye sonra. bunu tüm bölümlere uygula hell modunda. yine sabit olsun bu yeni paketler de öncekiler gibi bu işlemi bir kere yap kayıtlı olarak hell modu levellerinde kalsın
User prompt
bombayı hedeflere değdirmeden dışarı attığımızda puan silme
User prompt
bombayı fırlattığımızda 500 puan silinmesin bomba kutucuklardan birine çarparsa 500 puan silinsin. bombayı tuttuğumuzda silinen puanı 20 den 10 a düşür
User prompt
hala bomba sadece ilk bölümde oluşuyor hell mode u seçsem de
User prompt
bombayı tüm hell mode bölümlerine bugsuz bir şekilde ekle bomba oyundayken sürekli çalacak bomb sesini ve bomba kutucuğa çarparsa alev renklerinde patlama efeti yap ve blast sesini çal ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
hell modda bomba mekaniği ekle her 3 saniyede bir %25 şansla spawnlansın elimizde durduğu her 0.1 saniyede 20 puan silsin. kutucuklardan birine atarsak 500 puan silsin bomba elimizdeyken ekranda gözükecek bi texture de ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyunun başına hell mode ekle şimdilik birebir aynı olsun normal oyunla sadece notalar yukardan 4 kat daha hızlı insin
User prompt
notaları biraz daha yukardan spawnla aşşağı doğru
User prompt
oyunu büyütme şansımız var mı çok küçük kalmış ortada. herşeyi dikkate alarak büyüt bug olmasın
User prompt
oyunu kazandığımızda gameend sesi çalsın
User prompt
tamam kaçıncı saniyede animasyon tetikleneceğini ben belirliyorum saniyeler şunlar: 11, 23, 31, 41, 53, 63, 75, 85, 96, 107, 116, 128, 137, 149, 157, 169, 180, 190, 202, 214, 222, 232, 241, 253, 263, 271, 280, 290, 301, 310, 321, 329, 339, 349, 361, 370, 382, 394, 405, 414, 423, 435, 444, 452, 461, 471, 479, 490, 500, 510, 519, 527, 538, 546, 558, 567, 575, 584, 596, 608 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bu animasyon rasgele 8- 12 saniye aralıklarda sürekli tetiklensin mesela 9. saniye 21. saniye 30. saniye ...... 5 dakika falan sürsün bu bitirme hemen ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
neden sadece 1. bölümde çalışıyor tüm bölümlerde olmalı animasyon
User prompt
animasyonumuz artık 8-12 saniye aralığında bir tetiklensin ve tüm bölümlerde tetiklensin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
animasyon arena2 -3 -4 resimleri arena arkaplanı hariç diğer tüm nesnelerin arkasında kalmalı ve 1,6 saniye sonra kaybolmalılar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
arkaplan resmi genellikle arena olarak kalsın 7-10 saniyede bir animasyon tetiklensin. animasyon ise arena2-arena3-arena4 resimleri 0,4 saniye aralıkla peşpeşeekranda gözükecek ve yerini tekrar arena resmine bırakacak. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
turuncu kutucuğun hitbox ı küçük kaldı sanırım düzelt
User prompt
hedef kutucukların hitbox ını %30 arttır
User prompt
final bölümünde bir süre sonra paketler gelmeyı bıraktı neden
User prompt
şimdi final bölümü ekle 3.bölümden sonra bu bölüm 4 dakika. bu bölüm bittiğinde you win yazsın ve havayi fişekler patlasın 5 saniye sonra oyun bitsin. bir de bu bölümde puan -200 ün altına düştüğünde de oyun bitsin. zaten puan -200 un altındaysa da bölüm başladıktan sonra oyun bitsin yetersiz puan diye. final bölümünün süre aralıkları yine rasgele olsun ama yavaştan hızlıya doğru bi artış olsun rasgelelikte. bölümde ilk 30 saniyede 1,5 saniye 1,875 saniye aralıklarında. bölümdeki 30-60 saniye arası , 1,125 saniye 1,5 saniye 1,875 saniye aralıklarda 60- 180 inci saniye arasında , 1,125 saniye 1,5 saniye aralıklarında, son 1 dakika 180-240 ıncı saniye arası yani 0,75 1,125 saniye 1,5 saniye aralıklarında gelsin paketler ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
levle 3 müziğini de ayarla arkaplan
User prompt
aynı şekilde level 3 yap çoğunlukla 1,72 saniye biraz 2,15 saniye biraz 1,29 saniye aralıklarla paketler gelsin game over kısmı 3. levelin sonunda gelsin
User prompt
çok iyi level 1 e asla dokunma 2 saniyede 1 paket atmaya devam etsin. 2 levelde bu sefer paket sıralarının yanında gelme sürelerini de ayarla levelin kodlarında sabit olsun yine. tek seferlik rasgele aralıklar ekle çoğunlukla 1,72 saniye biraz 2,15 saniye çok az da 1,29 saniye aralıklarla paketler gelsin renk sırası level 1 le aynı olmasın değiştirip levelin içine kaydet sabit olsun yine
User prompt
oyun başladığında level 1 de yazsın ready nin üstüne, level 1 bittiğinde oyun bitmesin bölümbitsin ve tekrar ready yazısı çıksın level 2 yazsın
User prompt
level 1 bitince game over oldu onu level 2 den sonraya koy
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Character = Container.expand(function () {
var self = Container.call(this);
var characterGraphics = self.attachAsset('character', {
anchorX: 0.5,
anchorY: 0.5
});
self.heldPackage = null;
self.targetRotation = 0;
self.update = function () {
var rotationDiff = self.targetRotation - self.rotation;
while (rotationDiff > Math.PI) rotationDiff -= 2 * Math.PI;
while (rotationDiff < -Math.PI) rotationDiff += 2 * Math.PI;
self.rotation += rotationDiff * 0.1;
if (self.heldPackage) {
// Position package in front of character based on rotation
var packageDistance = 60; // Distance in front of character
var packageX = self.x + Math.cos(self.rotation) * packageDistance;
var packageY = self.y + Math.sin(self.rotation) * packageDistance;
// Smoothly tween package to new position for better visual flow
tween(self.heldPackage, {
x: packageX,
y: packageY,
rotation: self.rotation
}, {
duration: 100,
easing: tween.easeOut
});
}
};
return self;
});
var Confetti = Container.expand(function (colorValue) {
var self = Container.call(this);
var confettiGraphics = self.attachAsset('confetti', {
anchorX: 0.5,
anchorY: 0.5
});
confettiGraphics.tint = colorValue;
self.velocityX = (Math.random() - 0.5) * 400;
self.velocityY = (Math.random() - 0.5) * 400;
self.life = 60;
self.update = function () {
self.x += self.velocityX * (1 / 60);
self.y += self.velocityY * (1 / 60);
self.velocityY += 300 * (1 / 60);
self.life--;
if (self.life <= 0) {
self.alpha = 0;
}
};
return self;
});
var Package = Container.expand(function (colorValue) {
var self = Container.call(this);
var assetName = 'yellowpacket';
if (colorValue === 0x0066ff) assetName = 'bluepacket';else if (colorValue === 0xff0000) assetName = 'redpacket';else if (colorValue === 0xff8800) assetName = 'orangepacket';
var packageGraphics = self.attachAsset(assetName, {
anchorX: 0.5,
anchorY: 0.5
});
self.colorValue = colorValue || 0xffffff;
self.speed = 172.5; // 150 * 1.15 = 15% increase
self.caught = false;
self.thrown = false;
self.throwVelocityX = 0;
self.throwVelocityY = 0;
self.update = function () {
if (self.thrown) {
self.x += self.throwVelocityX;
self.y += self.throwVelocityY;
} else if (!self.caught) {
self.y += self.speed * (1 / 60);
}
};
return self;
});
var TargetBox = Container.expand(function (colorValue) {
var self = Container.call(this);
var assetName = 'targetYellow';
if (colorValue === 0x0066ff) assetName = 'targetBlue';else if (colorValue === 0xff0000) assetName = 'targetRed';else if (colorValue === 0xff8800) assetName = 'targetOrange';
var targetGraphics = self.attachAsset(assetName, {
anchorX: 0.5,
anchorY: 0.5
});
self.colorValue = colorValue;
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a1a
});
/****
* Game Code
****/
var gameWidth = 2048;
var gameHeight = 2732;
var arenaSize = 1200;
var arenaX = gameWidth / 2;
var arenaY = gameHeight / 2;
// Game arena
var arena = game.addChild(LK.getAsset('arena', {
anchorX: 0.5,
anchorY: 0.5,
x: arenaX,
y: arenaY
}));
// Character
var character = game.addChild(new Character());
character.x = arenaX;
character.y = arenaY;
// Target boxes at corners
var targets = [];
var targetColors = [0xffff00, 0x0066ff, 0xff0000, 0xff8800]; // yellow, blue, red, orange
var targetPositions = [{
x: arenaX - arenaSize / 2 + 120,
y: arenaY - arenaSize / 2 + 120
},
// top-left
{
x: arenaX + arenaSize / 2 - 120,
y: arenaY - arenaSize / 2 + 120
},
// top-right
{
x: arenaX - arenaSize / 2 + 120,
y: arenaY + arenaSize / 2 - 120
},
// bottom-left
{
x: arenaX + arenaSize / 2 - 120,
y: arenaY + arenaSize / 2 - 120
} // bottom-right
];
for (var i = 0; i < 4; i++) {
var target = game.addChild(new TargetBox(targetColors[i]));
target.x = targetPositions[i].x;
target.y = targetPositions[i].y;
targets.push(target);
}
// Game state
var packages = [];
var confettiParticles = [];
var gameTime = 0;
var gameDuration = 30000; // 30 seconds for levels 1-3, 240000 for final level
var packageSpawnInterval = 2000; // 2 seconds
var lastPackageSpawn = 0;
var gameStarted = false;
var gameEnded = false;
var gameReady = false;
var currentLevel = 1;
var levelCompleted = false;
var finalLevelStarted = false;
// Arena animation variables
var lastArenaAnimation = 0;
var arenaAnimationInterval = 8000; // 8-12 seconds interval
var isArenaAnimating = false;
var arenaAnimationStep = 0;
// Predetermined color sequence for level 1
var colorSequenceLevel1 = [0xffff00, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff0000, 0x0066ff, 0xff8800, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xff0000, 0x0066ff, 0xffff00, 0xff0000, 0xff8800, 0xffff00, 0x0066ff, 0xff8800, 0xff0000, 0xffff00, 0x0066ff];
// Level 2 color sequence and timing intervals (in milliseconds)
var colorSequenceLevel2 = [0xff0000, 0xff8800, 0x0066ff, 0xffff00, 0xff8800, 0xff0000, 0xffff00, 0x0066ff, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xffff00, 0xff8800, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0x0066ff, 0xff8800, 0xff0000, 0x0066ff, 0xffff00, 0xff8800, 0x0066ff, 0xffff00];
var timingIntervalsLevel2 = [1720, 2150, 1290, 1720, 1720, 2150, 1720, 1290, 1720, 1720, 1720, 2150, 1720, 1290, 1720, 1720, 1720, 1720, 2150, 1720, 1720, 1290, 1720, 1720, 1720, 1720, 1720, 2150, 1720, 1290];
// Level 3 color sequence and timing intervals (in milliseconds)
var colorSequenceLevel3 = [0x0066ff, 0xffff00, 0xff8800, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xff8800, 0x0066ff, 0xff0000, 0xffff00, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xffff00, 0xff8800, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xff8800, 0x0066ff, 0xffff00];
var timingIntervalsLevel3 = [1720, 1720, 2150, 1290, 1720, 1720, 1720, 2150, 1720, 1290, 1720, 1720, 1720, 1720, 2150, 1720, 1290, 1720, 1720, 1720, 2150, 1720, 1290, 1720, 1720, 1720, 1720, 2150, 1290, 1720];
// Final level color sequence (longer sequence for 4 minutes)
var colorSequenceFinal = [0xff0000, 0x0066ff, 0xffff00, 0xff8800, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0x0066ff, 0xff0000, 0xff8800, 0xffff00, 0xff8800, 0x0066ff, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0xffff00, 0xff8800, 0x0066ff, 0xff0000];
var currentSequenceIndex = 0;
var currentTimingIndex = 0;
// UI
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var timeTxt = new Text2('Time: 30', {
size: 60,
fill: 0xFFFFFF
});
timeTxt.anchor.set(1, 0);
LK.gui.topRight.addChild(timeTxt);
// Level display
var levelText = new Text2('LEVEL 1', {
size: 80,
fill: 0xFFFFFF
});
levelText.anchor.set(0.5, 0.5);
levelText.x = gameWidth / 2;
levelText.y = gameHeight / 2 - 150;
game.addChild(levelText);
// Ready button
var readyButton = new Text2('READY', {
size: 120,
fill: 0x00FF00
});
readyButton.anchor.set(0.5, 0.5);
readyButton.x = gameWidth / 2;
readyButton.y = gameHeight / 2;
game.addChild(readyButton);
// Ready button background
var readyButtonBg = LK.getAsset('package', {
anchorX: 0.5,
anchorY: 0.5,
x: gameWidth / 2,
y: gameHeight / 2,
scaleX: 3,
scaleY: 1.5
});
readyButtonBg.tint = 0x333333;
game.addChild(readyButtonBg);
readyButton.parent.setChildIndex(readyButton, readyButton.parent.children.length - 1);
// Helper functions
function getColorName(colorValue) {
switch (colorValue) {
case 0xffff00:
return 'Yellow';
case 0x0066ff:
return 'Blue';
case 0xff0000:
return 'Red';
case 0xff8800:
return 'Orange';
default:
return 'Unknown';
}
}
function spawnPackage() {
var currentColorSequence;
if (currentLevel === 1) {
currentColorSequence = colorSequenceLevel1;
} else if (currentLevel === 2) {
currentColorSequence = colorSequenceLevel2;
} else if (currentLevel === 3) {
currentColorSequence = colorSequenceLevel3;
} else {
currentColorSequence = colorSequenceFinal;
}
if (currentSequenceIndex >= currentColorSequence.length) return;
var packageColor = currentColorSequence[currentSequenceIndex];
currentSequenceIndex++;
var newPackage = new Package(packageColor);
newPackage.x = character.x; // Spawn directly above character
newPackage.y = arenaY - arenaSize / 2 - 50;
packages.push(newPackage);
game.addChild(newPackage);
}
function createConfettiExplosion(x, y, color) {
var allColors = [0xffff00, 0x0066ff, 0xff0000, 0xff8800]; // yellow, blue, red, orange
// Create more particles for bigger explosion (25 instead of 15)
for (var i = 0; i < 25; i++) {
var confettiColor;
if (i < 18) {
// Most particles (72%) use the main color
confettiColor = color;
} else {
// Some particles (28%) use random other colors
confettiColor = allColors[Math.floor(Math.random() * allColors.length)];
}
var confetti = new Confetti(confettiColor);
confetti.x = x;
confetti.y = y;
// Scale up confetti particles by 1.5x for bigger effect
tween(confetti, {
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 50,
easing: tween.easeOut
});
confettiParticles.push(confetti);
game.addChild(confetti);
}
}
function startArenaAnimation() {
if (isArenaAnimating) return;
isArenaAnimating = true;
arenaAnimationStep = 0;
// Start animation sequence
animateArenaStep();
}
function animateArenaStep() {
var arenaAssets = ['arena2', 'arena3', 'arena4'];
if (arenaAnimationStep < arenaAssets.length) {
// Change to next animation frame
var newArena = LK.getAsset(arenaAssets[arenaAnimationStep], {
anchorX: 0.5,
anchorY: 0.5,
x: arenaX,
y: arenaY,
scaleX: 12,
// Scale to match original arena size
scaleY: 12
});
// Add new arena behind all other objects (at index 1, after original arena)
game.addChildAt(newArena, 1);
// Auto-remove after 1.6 seconds
LK.setTimeout(function () {
newArena.destroy();
}, 1600);
arenaAnimationStep++;
// Schedule next step after 400ms
LK.setTimeout(function () {
animateArenaStep();
}, 400);
} else {
// Animation complete
isArenaAnimating = false;
}
}
function createFireworks() {
var fireworksColors = [0xffff00, 0x0066ff, 0xff0000, 0xff8800, 0x00ff00, 0xff00ff, 0x00ffff];
// Create multiple firework explosions across the screen
for (var f = 0; f < 8; f++) {
var fireworkX = Math.random() * gameWidth;
var fireworkY = Math.random() * (gameHeight * 0.6) + gameHeight * 0.2;
var fireworkColor = fireworksColors[Math.floor(Math.random() * fireworksColors.length)];
// Create 40 particles per firework for spectacular effect
for (var i = 0; i < 40; i++) {
var firework = new Confetti(fireworkColor);
firework.x = fireworkX;
firework.y = fireworkY;
// Enhanced velocities for bigger explosion
firework.velocityX = (Math.random() - 0.5) * 800;
firework.velocityY = (Math.random() - 0.5) * 600 - 200;
firework.life = 120; // Longer life for fireworks
// Scale and fade effect using tween
tween(firework, {
scaleX: 2.5,
scaleY: 2.5
}, {
duration: 100,
easing: tween.easeOut
});
tween(firework, {
alpha: 0
}, {
duration: 2000,
easing: tween.easeOut
});
confettiParticles.push(firework);
game.addChild(firework);
}
}
}
function checkPackageTargetCollision(packageObj, target) {
var dx = packageObj.x - target.x;
var dy = packageObj.y - target.y;
var distance = Math.sqrt(dx * dx + dy * dy);
// Orange target gets larger hitbox (50% larger than base 80 = 120)
if (target.colorValue === 0xff8800) {
return distance < 120; // Orange target gets bigger hitbox
}
return distance < 104; // Increased from 80 to 104 (30% increase) for other targets
}
function throwPackage(targetX, targetY) {
if (!character.heldPackage) {
// Empty click penalty
LK.setScore(LK.getScore() - 15);
LK.getSound('miss').play();
return;
}
var packageToThrow = character.heldPackage;
character.heldPackage = null;
var dx = targetX - packageToThrow.x;
var dy = targetY - packageToThrow.y;
var distance = Math.sqrt(dx * dx + dy * dy);
var speed = 800;
packageToThrow.throwVelocityX = dx / distance * speed * (1 / 60);
packageToThrow.throwVelocityY = dy / distance * speed * (1 / 60);
packageToThrow.thrown = true;
LK.getSound('throw').play();
}
// Event handlers
game.move = function (x, y, obj) {
var dx = x - character.x;
var dy = y - character.y;
character.targetRotation = Math.atan2(dy, dx);
};
game.down = function (x, y, obj) {
if (!gameReady) {
// Check if clicked on ready button area
var buttonX = gameWidth / 2;
var buttonY = gameHeight / 2;
var buttonWidth = 200;
var buttonHeight = 100;
if (x >= buttonX - buttonWidth && x <= buttonX + buttonWidth && y >= buttonY - buttonHeight && y <= buttonY + buttonHeight) {
gameReady = true;
readyButton.destroy();
readyButtonBg.destroy();
levelText.destroy();
}
return;
}
if (gameEnded) return;
throwPackage(x, y);
};
// Main game update
game.update = function () {
if (!gameReady) return;
if (!gameStarted) {
gameStarted = true;
gameTime = 0; // Reset game time when starting
lastPackageSpawn = 0; // Reset package spawn timer
if (currentLevel === 1) {
LK.getSound('level1').play();
LK.playMusic('bgmusic');
} else if (currentLevel === 2) {
LK.getSound('level2').play();
LK.playMusic('bgmusic');
} else if (currentLevel === 3) {
LK.getSound('level3').play();
LK.playMusic('bgmusic3');
} else if (currentLevel === 4) {
LK.getSound('final').play();
LK.playMusic('bgmusicfinal');
gameDuration = 240000; // 4 minutes for final level
finalLevelStarted = true;
}
}
if (gameEnded) return;
// Arena animation trigger (8-12 seconds interval) - works for all levels
if (gameTime - lastArenaAnimation >= arenaAnimationInterval) {
startArenaAnimation();
// Set next random interval between 8-12 seconds (8000-12000ms)
arenaAnimationInterval = 8000 + Math.random() * 4000;
lastArenaAnimation = gameTime;
}
// Check for insufficient score in final level
if (currentLevel === 4) {
if (LK.getScore() < -200) {
gameEnded = true;
LK.showGameOver();
return;
}
}
gameTime += 1000 / 60; // Increment game time only after ready
var remainingTime = Math.max(0, Math.ceil((gameDuration - gameTime) / 1000));
timeTxt.setText('Time: ' + remainingTime);
// Check for level completion
if (gameTime >= gameDuration) {
if (currentLevel === 1) {
// Level 1 completed, prepare for level 2
currentLevel = 2;
levelCompleted = true;
gameStarted = false;
gameReady = false;
gameEnded = false;
gameTime = 0;
lastPackageSpawn = 0;
currentSequenceIndex = 0;
currentTimingIndex = 0;
// Reset character state
character.heldPackage = null;
character.x = arenaX;
character.y = arenaY;
character.rotation = 0;
character.targetRotation = 0;
// Clear all packages
for (var p = packages.length - 1; p >= 0; p--) {
packages[p].destroy();
packages.splice(p, 1);
}
// Clear all confetti
for (var c = confettiParticles.length - 1; c >= 0; c--) {
confettiParticles[c].destroy();
confettiParticles.splice(c, 1);
}
// Show level 2 ready screen
levelText = new Text2('LEVEL 2', {
size: 80,
fill: 0xFFFFFF
});
levelText.anchor.set(0.5, 0.5);
levelText.x = gameWidth / 2;
levelText.y = gameHeight / 2 - 150;
game.addChild(levelText);
readyButton = new Text2('READY', {
size: 120,
fill: 0x00FF00
});
readyButton.anchor.set(0.5, 0.5);
readyButton.x = gameWidth / 2;
readyButton.y = gameHeight / 2;
game.addChild(readyButton);
readyButtonBg = LK.getAsset('package', {
anchorX: 0.5,
anchorY: 0.5,
x: gameWidth / 2,
y: gameHeight / 2,
scaleX: 3,
scaleY: 1.5
});
readyButtonBg.tint = 0x333333;
game.addChild(readyButtonBg);
readyButton.parent.setChildIndex(readyButton, readyButton.parent.children.length - 1);
return;
} else if (currentLevel === 2) {
// Level 2 completed, prepare for level 3
currentLevel = 3;
levelCompleted = true;
gameStarted = false;
gameReady = false;
gameEnded = false;
gameTime = 0;
lastPackageSpawn = 0;
currentSequenceIndex = 0;
currentTimingIndex = 0;
// Reset character state
character.heldPackage = null;
character.x = arenaX;
character.y = arenaY;
character.rotation = 0;
character.targetRotation = 0;
// Clear all packages
for (var p = packages.length - 1; p >= 0; p--) {
packages[p].destroy();
packages.splice(p, 1);
}
// Clear all confetti
for (var c = confettiParticles.length - 1; c >= 0; c--) {
confettiParticles[c].destroy();
confettiParticles.splice(c, 1);
}
// Show level 3 ready screen
levelText = new Text2('LEVEL 3', {
size: 80,
fill: 0xFFFFFF
});
levelText.anchor.set(0.5, 0.5);
levelText.x = gameWidth / 2;
levelText.y = gameHeight / 2 - 150;
game.addChild(levelText);
readyButton = new Text2('READY', {
size: 120,
fill: 0x00FF00
});
readyButton.anchor.set(0.5, 0.5);
readyButton.x = gameWidth / 2;
readyButton.y = gameHeight / 2;
game.addChild(readyButton);
readyButtonBg = LK.getAsset('package', {
anchorX: 0.5,
anchorY: 0.5,
x: gameWidth / 2,
y: gameHeight / 2,
scaleX: 3,
scaleY: 1.5
});
readyButtonBg.tint = 0x333333;
game.addChild(readyButtonBg);
readyButton.parent.setChildIndex(readyButton, readyButton.parent.children.length - 1);
return;
} else if (currentLevel === 3) {
// Level 3 completed, prepare for final level
currentLevel = 4;
levelCompleted = true;
gameStarted = false;
gameReady = false;
gameEnded = false;
gameTime = 0;
lastPackageSpawn = 0;
currentSequenceIndex = 0;
currentTimingIndex = 0;
// Reset character state
character.heldPackage = null;
character.x = arenaX;
character.y = arenaY;
character.rotation = 0;
character.targetRotation = 0;
// Clear all packages
for (var p = packages.length - 1; p >= 0; p--) {
packages[p].destroy();
packages.splice(p, 1);
}
// Clear all confetti
for (var c = confettiParticles.length - 1; c >= 0; c--) {
confettiParticles[c].destroy();
confettiParticles.splice(c, 1);
}
// Show final level ready screen
levelText = new Text2('FINAL LEVEL', {
size: 80,
fill: 0xFFD700
});
levelText.anchor.set(0.5, 0.5);
levelText.x = gameWidth / 2;
levelText.y = gameHeight / 2 - 150;
game.addChild(levelText);
readyButton = new Text2('READY', {
size: 120,
fill: 0x00FF00
});
readyButton.anchor.set(0.5, 0.5);
readyButton.x = gameWidth / 2;
readyButton.y = gameHeight / 2;
game.addChild(readyButton);
readyButtonBg = LK.getAsset('package', {
anchorX: 0.5,
anchorY: 0.5,
x: gameWidth / 2,
y: gameHeight / 2,
scaleX: 3,
scaleY: 1.5
});
readyButtonBg.tint = 0x333333;
game.addChild(readyButtonBg);
readyButton.parent.setChildIndex(readyButton, readyButton.parent.children.length - 1);
return;
} else {
// Final level completed - you win with fireworks
gameEnded = true;
createFireworks();
LK.setTimeout(function () {
LK.showYouWin();
}, 5000);
return;
}
}
// Spawn packages
var currentColorSequence;
if (currentLevel === 1) {
currentColorSequence = colorSequenceLevel1;
} else if (currentLevel === 2) {
currentColorSequence = colorSequenceLevel2;
} else {
currentColorSequence = colorSequenceLevel3;
}
var currentSpawnInterval;
if (currentLevel === 1) {
currentSpawnInterval = packageSpawnInterval; // Keep 2000ms for level 1
} else if (currentLevel === 2) {
// Level 2 uses custom timing intervals
if (currentTimingIndex < timingIntervalsLevel2.length) {
currentSpawnInterval = timingIntervalsLevel2[currentTimingIndex];
} else {
currentSpawnInterval = 1720; // Default fallback
}
} else if (currentLevel === 3) {
// Level 3 uses custom timing intervals
if (currentTimingIndex < timingIntervalsLevel3.length) {
currentSpawnInterval = timingIntervalsLevel3[currentTimingIndex];
} else {
currentSpawnInterval = 1720; // Default fallback
}
} else if (currentLevel === 4) {
// Final level uses progressive timing based on game time
var progressiveTiming = [1500, 1875]; // 0-30 seconds
if (gameTime >= 30000 && gameTime < 60000) {
progressiveTiming = [1125, 1500, 1875]; // 30-60 seconds
} else if (gameTime >= 60000 && gameTime < 180000) {
progressiveTiming = [1125, 1500]; // 60-180 seconds
} else if (gameTime >= 180000) {
progressiveTiming = [750, 1125, 1500]; // 180-240 seconds
}
currentSpawnInterval = progressiveTiming[Math.floor(Math.random() * progressiveTiming.length)];
}
if (gameTime - lastPackageSpawn >= currentSpawnInterval) {
// For final level, allow sequence to loop when exhausted
if (currentLevel === 4 && currentSequenceIndex >= currentColorSequence.length) {
currentSequenceIndex = 0; // Reset to beginning of sequence
}
// Only spawn if we have colors available or it's the final level
if (currentSequenceIndex < currentColorSequence.length || currentLevel === 4) {
spawnPackage();
if (currentLevel === 2 || currentLevel === 3) {
currentTimingIndex++;
}
lastPackageSpawn = gameTime;
}
}
// Update packages
for (var i = packages.length - 1; i >= 0; i--) {
var pkg = packages[i];
if (pkg.lastY === undefined) pkg.lastY = pkg.y;
if (pkg.lastCaught === undefined) pkg.lastCaught = false;
if (pkg.lastThrown === undefined) pkg.lastThrown = false;
// Check if package reached character (catch)
if (!pkg.caught && !pkg.thrown) {
var distanceToCharacter = Math.sqrt(Math.pow(pkg.x - character.x, 2) + Math.pow(pkg.y - character.y, 2));
if (distanceToCharacter < 50) {
if (!character.heldPackage) {
pkg.caught = true;
character.heldPackage = pkg;
LK.getSound('catch').play();
}
}
}
// Check if package fell off screen (drop penalty)
if (!pkg.caught && !pkg.thrown && pkg.y > arenaY + arenaSize / 2 + 100) {
LK.setScore(LK.getScore() - 150);
pkg.destroy();
packages.splice(i, 1);
continue;
}
// Check thrown package collisions with targets
if (pkg.thrown) {
var hitTarget = false;
for (var j = 0; j < targets.length; j++) {
var target = targets[j];
if (checkPackageTargetCollision(pkg, target)) {
if (pkg.colorValue === target.colorValue) {
// Correct color match
LK.setScore(LK.getScore() + 100);
createConfettiExplosion(target.x, target.y, pkg.colorValue);
LK.getSound('hit').play();
} else {
// Wrong color penalty
LK.setScore(LK.getScore() - 60);
LK.getSound('miss').play();
}
hitTarget = true;
break;
}
}
if (hitTarget || pkg.x < 0 || pkg.x > gameWidth || pkg.y < 0 || pkg.y > gameHeight) {
if (!hitTarget) {
// Missed throw penalty
LK.setScore(LK.getScore() - 60);
LK.getSound('miss').play();
}
pkg.destroy();
packages.splice(i, 1);
continue;
}
}
pkg.lastY = pkg.y;
pkg.lastCaught = pkg.caught;
pkg.lastThrown = pkg.thrown;
}
// Update confetti
for (var i = confettiParticles.length - 1; i >= 0; i--) {
var confetti = confettiParticles[i];
if (confetti.alpha <= 0) {
confetti.destroy();
confettiParticles.splice(i, 1);
}
}
// Update score display
scoreTxt.setText('Score: ' + LK.getScore());
}; ===================================================================
--- original.js
+++ change.js
@@ -431,11 +431,12 @@
}
}
if (gameEnded) return;
// Arena animation trigger (8-12 seconds interval) - works for all levels
- var randomInterval = arenaAnimationInterval + Math.random() * 4000; // 8-12 seconds
- if (gameTime - lastArenaAnimation >= randomInterval) {
+ if (gameTime - lastArenaAnimation >= arenaAnimationInterval) {
startArenaAnimation();
+ // Set next random interval between 8-12 seconds (8000-12000ms)
+ arenaAnimationInterval = 8000 + Math.random() * 4000;
lastArenaAnimation = gameTime;
}
// Check for insufficient score in final level
if (currentLevel === 4) {
bire bir aynı daha açık parlak sarı
birebir aynısı sarı-gri renkleri biraz daha koyu gri ile karıştır mavi-gri renklerin maviliğini biraz arttır. biraz da kırmızı-gri kareleri düzel
birebir aynısı. karelerin yerlerini değiştir dizilimi bozmadan
fitili ateşlenmiş parlak üzerinde yeşil tehlike işareti olan siyah bomba. In-Game asset. 2d. High contrast. No shadows
müzik temalı cool ready yazısı biraz da sprey boya punk tarzı. In-Game asset. 2d. High contrast. No shadows
dehşet saçan bir hell mode yazısı tek line olsun geniş kısa. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
açık mavi dj masası ekipmanı. In-Game asset. 2d. High contrast. No shadows
aynı stil daha parlak ve altınımsı mikrofon ve kulaklığı kaldır
orange cool dj keyboard rgb keys. In-Game asset. 2d. High contrast. No shadows
red cool dj headset rgp neon. In-Game asset. 2d. High contrast. No shadows