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 var packageSpawnInterval = 2000; // 2 seconds var lastPackageSpawn = 0; var gameStarted = false; var gameEnded = false; var gameReady = false; var currentLevel = 1; var levelCompleted = false; // Predetermined color sequence for level 1 var colorSequence = [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]; var currentSequenceIndex = 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() { if (currentSequenceIndex >= colorSequence.length) return; var packageColor = colorSequence[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 checkPackageTargetCollision(packageObj, target) { var dx = packageObj.x - target.x; var dy = packageObj.y - target.y; var distance = Math.sqrt(dx * dx + dy * dy); return distance < 80; } 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(); } else if (currentLevel === 2) { LK.getSound('level2').play(); } LK.playMusic('bgmusic'); } if (gameEnded) 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; // 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 { // Level 2 completed gameEnded = true; if (LK.getScore() >= 3000) { LK.showYouWin(); } else { LK.showGameOver(); } return; } } // Spawn packages if (gameTime - lastPackageSpawn >= packageSpawnInterval && currentSequenceIndex < colorSequence.length) { spawnPackage(); 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
@@ -158,20 +158,12 @@
var lastPackageSpawn = 0;
var gameStarted = false;
var gameEnded = false;
var gameReady = false;
-// Level system
var currentLevel = 1;
-var maxLevel = 2;
-// Level 1 data
-var level1ColorSequence = [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];
-var level1SpawnIntervals = [1720, 1720, 2150, 1720, 1290, 1720, 1720, 2150, 1720, 1720, 1290, 1720, 2150, 1720, 1720, 1290, 1720, 1720, 2150, 1720, 1290, 1720, 1720, 2150, 1720, 1720, 1290, 1720, 1720, 2150];
-// Level 2 data
-var level2ColorSequence = [0xff0000, 0x0066ff, 0xffff00, 0xff8800, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xff0000, 0xff8800, 0x0066ff, 0xffff00, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xffff00, 0x0066ff, 0xff8800, 0xff0000, 0xff8800, 0xffff00, 0x0066ff, 0xff0000, 0x0066ff, 0xff8800, 0xffff00, 0xff0000, 0xffff00];
-var level2SpawnIntervals = [1290, 1720, 1720, 2150, 1290, 1720, 1290, 1720, 2150, 1720, 1290, 1720, 1720, 2150, 1290, 1720, 1720, 1290, 2150, 1720, 1290, 1720, 1720, 2150, 1290, 1720, 1290, 1720, 2150, 1720];
-// Current level data
-var colorSequence = level1ColorSequence;
-var spawnIntervals = level1SpawnIntervals;
+var levelCompleted = false;
+// Predetermined color sequence for level 1
+var colorSequence = [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];
var currentSequenceIndex = 0;
// UI
var scoreTxt = new Text2('Score: 0', {
size: 80,
@@ -184,8 +176,17 @@
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
@@ -205,17 +206,8 @@
});
readyButtonBg.tint = 0x333333;
game.addChild(readyButtonBg);
readyButton.parent.setChildIndex(readyButton, readyButton.parent.children.length - 1);
-// Level text
-var levelTxt = new Text2('LEVEL 1', {
- size: 100,
- fill: 0xFFFF00
-});
-levelTxt.anchor.set(0.5, 0.5);
-levelTxt.x = gameWidth / 2;
-levelTxt.y = gameHeight / 2 - 150;
-game.addChild(levelTxt);
// Helper functions
function getColorName(colorValue) {
switch (colorValue) {
case 0xffff00:
@@ -239,44 +231,8 @@
newPackage.y = arenaY - arenaSize / 2 - 50;
packages.push(newPackage);
game.addChild(newPackage);
}
-function getNextSpawnInterval() {
- if (currentSequenceIndex >= spawnIntervals.length) return 1720; // Default interval
- return spawnIntervals[currentSequenceIndex];
-}
-function switchToLevel2() {
- currentLevel = 2;
- colorSequence = level2ColorSequence;
- spawnIntervals = level2SpawnIntervals;
- currentSequenceIndex = 0;
- gameTime = 0;
- lastPackageSpawn = 0;
- gameStarted = false;
- gameEnded = false;
- gameReady = false;
- levelTxt.setText('LEVEL 2');
- // Show ready button again
- 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);
-}
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++) {
@@ -343,11 +299,9 @@
if (x >= buttonX - buttonWidth && x <= buttonX + buttonWidth && y >= buttonY - buttonHeight && y <= buttonY + buttonHeight) {
gameReady = true;
readyButton.destroy();
readyButtonBg.destroy();
- if (currentLevel > 1) {
- levelTxt.destroy();
- }
+ levelText.destroy();
}
return;
}
if (gameEnded) return;
@@ -359,43 +313,89 @@
if (!gameStarted) {
gameStarted = true;
gameTime = 0; // Reset game time when starting
lastPackageSpawn = 0; // Reset package spawn timer
- LK.getSound('level1').play();
+ if (currentLevel === 1) {
+ LK.getSound('level1').play();
+ } else if (currentLevel === 2) {
+ LK.getSound('level2').play();
+ }
LK.playMusic('bgmusic');
}
if (gameEnded) 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 (currentSequenceIndex >= colorSequence.length && packages.length === 0) {
- if (currentLevel < maxLevel) {
- switchToLevel2();
+ 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;
+ // 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 {
+ // Level 2 completed
gameEnded = true;
- if (LK.getScore() >= 1500) {
+ if (LK.getScore() >= 3000) {
LK.showYouWin();
} else {
LK.showGameOver();
}
return;
}
}
- // Check for game end by time (only for level 2)
- if (gameTime >= gameDuration && currentLevel >= maxLevel) {
- gameEnded = true;
- if (LK.getScore() >= 1500) {
- LK.showYouWin();
- } else {
- LK.showGameOver();
- }
- return;
- }
- // Spawn packages with dynamic intervals
- var nextInterval = getNextSpawnInterval();
- if (gameTime - lastPackageSpawn >= nextInterval && currentSequenceIndex < colorSequence.length) {
+ // Spawn packages
+ if (gameTime - lastPackageSpawn >= packageSpawnInterval && currentSequenceIndex < colorSequence.length) {
spawnPackage();
lastPackageSpawn = gameTime;
}
// Update packages
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