User prompt
80 percent more likely to go out on foot
User prompt
Change the appearance of pedestrians and there will be an 80 percent chance of more of them
User prompt
let me change the appearance of pedestrians
User prompt
yüzde 40 çıkar
User prompt
Increase the chance of pedestrians being thrown into the road by 60 percent
User prompt
Occasionally pedestrians jump onto the road
User prompt
center path
User prompt
rapa sıklıkla çıksın
User prompt
have good graphics
User prompt
Let the text be shaded
User prompt
simplify start button
User prompt
There is a round circle behind the start button
User prompt
I will design the start button
User prompt
design the start button
User prompt
You design the ramp
User prompt
Make the menu very simple, fantastic and clear, and put the start button at the bottom
User prompt
Let it be a rapa once in a while
User prompt
remove hidden button feature
User prompt
Let the secret button be quite obvious
User prompt
The secret button should be under the speed text.
User prompt
as a special power, either bending the roads and making cars crash into each other or being super fast ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Place a secret button in the menu and click on this button to get a special power or have a fast car come from 4 roads at the same time.
User prompt
playercar2 Click 10 times and throw it to a road full of trophies
User prompt
If you tap playercar3 10 times, it will say "Thank you Yavuz Abi" in the score area.
User prompt
If you tap playercar1 10 times at the entrance, it will start from 2000 directly.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.attachAsset('powerUp', { anchorX: 0.5, anchorY: 0.5 }); // Make bomb look dangerous with dark red tint and smaller size bombGraphics.tint = 0x660000; bombGraphics.scaleX = 0.6; bombGraphics.scaleY = 0.6; self.speed = 12; self.targetLane = 1; self.rotationSpeed = 0.3; self.pulseScale = 1; self.pulseDirection = 1; self.update = function () { self.speed = 12 * gameSpeed; self.y += self.speed; // Move towards target lane (player's position when thrown) var targetX = 424 + self.targetLane * 400; var diff = targetX - self.x; if (Math.abs(diff) > 10) { self.x += diff * 0.1; } // Spinning and pulsing animation for danger effect bombGraphics.rotation += self.rotationSpeed; self.pulseScale += self.pulseDirection * 0.05; if (self.pulseScale > 1.3) { self.pulseDirection = -1; } else if (self.pulseScale < 0.8) { self.pulseDirection = 1; } bombGraphics.scaleX = 0.6 * self.pulseScale; bombGraphics.scaleY = 0.6 * self.pulseScale; }; return self; }); var Bomber = Container.expand(function () { var self = Container.call(this); var bomberGraphics = self.attachAsset('bomberPerson', { anchorX: 0.5, anchorY: 0.5 }); // Make bomber distinct with darker brown color and human-like proportions bomberGraphics.scaleX = 0.8; bomberGraphics.scaleY = 0.9; self.speed = 6; self.lane = 0; self.throwTimer = 0; self.throwInterval = 120; // Throw bomb every 2 seconds self.hasThrown = false; self.update = function () { var difficultyMultiplier = 1 + distanceTraveled / 10000; self.speed = 6 * gameSpeed * difficultyMultiplier; self.y += self.speed; // Throw bomb when close to player self.throwTimer++; if (!self.hasThrown && self.throwTimer >= self.throwInterval && self.y > 500 && self.y < 1800) { self.throwBomb(); self.hasThrown = true; } // Add slight bobbing motion bomberGraphics.rotation = Math.sin(LK.ticks * 0.03) * 0.1; }; self.throwBomb = function () { var bomb = game.addChild(new Bomb()); bomb.x = self.x; bomb.y = self.y + 50; bomb.targetLane = playerCar.currentLane; bomb.speed = 12 * gameSpeed; bombs.push(bomb); }; return self; }); var Cup = Container.expand(function () { var self = Container.call(this); var cupGraphics = self.attachAsset('cup', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.rotationSpeed = 0.15; self.pulseScale = 1; self.pulseDirection = 1; self.update = function () { self.speed = 8 * gameSpeed; self.y += self.speed; cupGraphics.rotation += self.rotationSpeed; // Pulsing effect self.pulseScale += self.pulseDirection * 0.03; if (self.pulseScale > 1.4) { self.pulseDirection = -1; } else if (self.pulseScale < 0.9) { self.pulseDirection = 1; } cupGraphics.scaleX = self.pulseScale; cupGraphics.scaleY = self.pulseScale; // Golden tint for visual appeal cupGraphics.tint = 0xFFD700; }; return self; }); var EnemyCar = Container.expand(function (carType) { var self = Container.call(this); var assetId = carType || 'enemyCar1'; var carGraphics = self.attachAsset(assetId, { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.lane = 0; self.update = function () { // Progressive speed increase with difficulty var difficultyMultiplier = 1 + distanceTraveled / 8000; // Enemies get faster over time self.speed = 8 * gameSpeed * difficultyMultiplier; self.y += self.speed; // Add subtle bobbing motion for visual interest carGraphics.rotation = Math.sin(LK.ticks * 0.05) * 0.02; }; return self; }); var Explosion = Container.expand(function () { var self = Container.call(this); self.particles = []; self.lifeTime = 0; self.maxLifeTime = 60; // 1 second at 60fps // Create explosion particles for (var i = 0; i < 12; i++) { var particle = self.addChild(LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.3, scaleY: 0.3 })); particle.tint = [0xFF4500, 0xFF6600, 0xFF8800, 0xFFAA00, 0xFFCC00][Math.floor(Math.random() * 5)]; particle.vx = (Math.random() - 0.5) * 20; particle.vy = (Math.random() - 0.5) * 20; particle.gravity = 0.5; particle.friction = 0.95; self.particles.push(particle); } self.update = function () { self.lifeTime++; // Update particles for (var i = 0; i < self.particles.length; i++) { var particle = self.particles[i]; particle.x += particle.vx; particle.y += particle.vy; particle.vy += particle.gravity; particle.vx *= particle.friction; particle.vy *= particle.friction; // Fade out over time particle.alpha = 1 - self.lifeTime / self.maxLifeTime; } // Destroy explosion when done if (self.lifeTime >= self.maxLifeTime) { self.destroy(); } }; return self; }); var Nitro = Container.expand(function () { var self = Container.call(this); var nitroGraphics = self.attachAsset('nitro', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.rotationSpeed = 0.2; self.pulseScale = 1; self.pulseDirection = 1; self.update = function () { self.y += self.speed; nitroGraphics.rotation += self.rotationSpeed; // Pulsing effect self.pulseScale += self.pulseDirection * 0.02; if (self.pulseScale > 1.3) { self.pulseDirection = -1; } else if (self.pulseScale < 0.8) { self.pulseDirection = 1; } nitroGraphics.scaleX = self.pulseScale; nitroGraphics.scaleY = self.pulseScale; }; return self; }); var PlayerCar = Container.expand(function () { var self = Container.call(this); var carGraphics = self.attachAsset('playerCar', { anchorX: 0.5, anchorY: 0.5 }); self.targetLane = 1; self.currentLane = 1; self.laneWidth = 400; self.moveSpeed = 0.35; self.update = function () { var targetX = self.getLaneX(self.targetLane); var diff = targetX - self.x; var adjustedMoveSpeed = self.moveSpeed * (1 + (gameSpeed - 1) * 0.5); if (Math.abs(diff) > 5) { self.x += diff * adjustedMoveSpeed; } else { self.x = targetX; self.currentLane = self.targetLane; } // Handle jumping animation if (playerJumping) { var jumpProgress = (LK.ticks - jumpStartTime) / jumpDuration; if (jumpProgress >= 1) { // Jump finished playerJumping = false; jumpHeight = 0; carGraphics.y = 0; carGraphics.rotation = 0; } else { // Calculate jump arc (parabolic motion) jumpHeight = Math.sin(jumpProgress * Math.PI) * 100; carGraphics.y = -jumpHeight; // Add rotation during jump carGraphics.rotation = Math.sin(jumpProgress * Math.PI) * 0.2; } } }; self.getLaneX = function (lane) { return 424 + lane * self.laneWidth; }; self.switchLane = function (direction) { var newLane = self.targetLane + direction; if (newLane >= 0 && newLane <= 3) { self.targetLane = newLane; // Add slow dramatic turn effect when switching lanes tween(carGraphics, { rotation: direction * 0.4 }, { duration: 800, easing: tween.easeOut, onFinish: function onFinish() { tween(carGraphics, { rotation: 0 }, { duration: 600, easing: tween.easeIn }); } }); } }; return self; }); var PlayerCar2 = Container.expand(function () { var self = Container.call(this); var carGraphics = self.attachAsset('playerCar2', { anchorX: 0.5, anchorY: 0.5 }); self.targetLane = 1; self.currentLane = 1; self.laneWidth = 400; self.moveSpeed = 0.42; // Much faster lane switching speed self.update = function () { var targetX = self.getLaneX(self.targetLane); var diff = targetX - self.x; var adjustedMoveSpeed = self.moveSpeed * (1 + (gameSpeed - 1) * 0.5); if (Math.abs(diff) > 5) { self.x += diff * adjustedMoveSpeed; } else { self.x = targetX; self.currentLane = self.targetLane; } // Handle jumping animation if (playerJumping) { var jumpProgress = (LK.ticks - jumpStartTime) / jumpDuration; if (jumpProgress >= 1) { playerJumping = false; jumpHeight = 0; carGraphics.y = 0; carGraphics.rotation = 0; } else { jumpHeight = Math.sin(jumpProgress * Math.PI) * 100; carGraphics.y = -jumpHeight; carGraphics.rotation = Math.sin(jumpProgress * Math.PI) * 0.25; } } }; self.getLaneX = function (lane) { return 424 + lane * self.laneWidth; }; self.switchLane = function (direction) { var newLane = self.targetLane + direction; if (newLane >= 0 && newLane <= 3) { self.targetLane = newLane; // Add slow dramatic turn effect when switching lanes with different rotation tween(carGraphics, { rotation: direction * 0.5 }, { duration: 900, easing: tween.easeOut, onFinish: function onFinish() { tween(carGraphics, { rotation: 0 }, { duration: 700, easing: tween.easeIn }); } }); } }; return self; }); var PlayerCar3 = Container.expand(function () { var self = Container.call(this); var carGraphics = self.attachAsset('playerCar3', { anchorX: 0.5, anchorY: 0.5 }); self.targetLane = 1; self.currentLane = 1; self.laneWidth = 400; self.moveSpeed = 0.38; // Faster lane switching speed self.update = function () { var targetX = self.getLaneX(self.targetLane); var diff = targetX - self.x; var adjustedMoveSpeed = self.moveSpeed * (1 + (gameSpeed - 1) * 0.5); if (Math.abs(diff) > 5) { self.x += diff * adjustedMoveSpeed; } else { self.x = targetX; self.currentLane = self.targetLane; } // Handle jumping animation if (playerJumping) { var jumpProgress = (LK.ticks - jumpStartTime) / jumpDuration; if (jumpProgress >= 1) { playerJumping = false; jumpHeight = 0; carGraphics.y = 0; carGraphics.rotation = 0; } else { jumpHeight = Math.sin(jumpProgress * Math.PI) * 100; carGraphics.y = -jumpHeight; carGraphics.rotation = Math.sin(jumpProgress * Math.PI) * 0.15; } } }; self.getLaneX = function (lane) { return 424 + lane * self.laneWidth; }; self.switchLane = function (direction) { var newLane = self.targetLane + direction; if (newLane >= 0 && newLane <= 3) { self.targetLane = newLane; // Add slow dramatic turn effect when switching lanes tween(carGraphics, { rotation: direction * 0.3 }, { duration: 750, easing: tween.easeOut, onFinish: function onFinish() { tween(carGraphics, { rotation: 0 }, { duration: 550, easing: tween.easeIn }); } }); } }; return self; }); var PowerUp = Container.expand(function () { var self = Container.call(this); var powerUpGraphics = self.attachAsset('powerUp', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.rotationSpeed = 0.1; self.update = function () { self.speed = 8 * gameSpeed; self.y += self.speed; powerUpGraphics.rotation += self.rotationSpeed; }; return self; }); var Ramp = Container.expand(function () { var self = Container.call(this); // Create ramp visual using multiple road line assets var rampBase = self.attachAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 8, scaleY: 2 }); rampBase.tint = 0x888888; var rampTop = self.attachAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 6, scaleY: 1, y: -20 }); rampTop.tint = 0xAAAAA; self.speed = 8; self.lane = 0; self.update = function () { self.speed = 8 * gameSpeed; self.y += self.speed; // Add slight glow effect rampBase.alpha = 0.8 + Math.sin(LK.ticks * 0.1) * 0.2; }; return self; }); var RoadLine = Container.expand(function () { var self = Container.call(this); var lineGraphics = self.attachAsset('roadLine', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.update = function () { self.speed = 8 * gameSpeed; self.y += self.speed; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2c3e50 }); /**** * Game Code ****/ // Game state management var gameState = 'menu'; // 'menu', 'playing', 'gameOver' var menuElements = []; var bestDistance = 0; // Load best score from storage function loadBestScore() { var saved = storage.bestDistance; if (saved !== undefined) { bestDistance = saved; } } // Save best score to storage function saveBestScore() { storage.bestDistance = bestDistance; } // Start menu creation function createStartMenu() { // Simple road background - just a few lines for context for (var i = 0; i < 8; i++) { for (var lane = 0; lane < 4; lane++) { var menuLine = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, x: 624 + lane * 400, y: i * 250 + 300 }); menuLine.alpha = 0.2; game.addChild(menuLine); menuElements.push(menuLine); } } // Clean title - big and centered var titleText = new Text2('HIGHWAY RUSH', { size: 160, fill: '#FFD700' }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 600; game.addChild(titleText); menuElements.push(titleText); // Best score display - simple and clear var bestScoreText = new Text2('Best: ' + bestDistance + 'm', { size: 70, fill: '#FFFFFF' }); bestScoreText.anchor.set(0.5, 0.5); bestScoreText.x = 1024; bestScoreText.y = 750; game.addChild(bestScoreText); menuElements.push(bestScoreText); // Car selection section - clean and organized var carSelectionText = new Text2('Choose Car:', { size: 60, fill: '#FFFFFF' }); carSelectionText.anchor.set(0.5, 0.5); carSelectionText.x = 1024; carSelectionText.y = 950; game.addChild(carSelectionText); menuElements.push(carSelectionText); // Car selection buttons - centered and organized var car1Button = LK.getAsset('playerCar', { anchorX: 0.5, anchorY: 0.5, x: 624, y: 1150, scaleX: 1.0, scaleY: 1.0 }); game.addChild(car1Button); menuElements.push(car1Button); var car2Button = LK.getAsset('playerCar2', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1150, scaleX: 1.0, scaleY: 1.0 }); game.addChild(car2Button); menuElements.push(car2Button); var car3Button = LK.getAsset('playerCar3', { anchorX: 0.5, anchorY: 0.5, x: 1424, y: 1150, scaleX: 1.0, scaleY: 1.0 }); game.addChild(car3Button); menuElements.push(car3Button); // Selection indicator selectionIndicator = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 8, scaleY: 0.8, x: selectedCarType === 0 ? 624 : selectedCarType === 1 ? 1024 : 1424, y: 1280 }); selectionIndicator.tint = 0xFFD700; game.addChild(selectionIndicator); menuElements.push(selectionIndicator); // Instructions - simple and clear var instructionsText = new Text2('Swipe to change lanes • Avoid traffic • Collect power-ups', { size: 50, fill: '#CCCCCC' }); instructionsText.anchor.set(0.5, 0.5); instructionsText.x = 1024; instructionsText.y = 1450; game.addChild(instructionsText); menuElements.push(instructionsText); // START BUTTON AT BOTTOM - modern octagonal design with depth and glow // Create octagonal button base using multiple elements var buttonShadow = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 30, scaleY: 4, x: 1024, y: 2415 }); buttonShadow.tint = 0x001100; buttonShadow.alpha = 0.7; buttonShadow.rotation = Math.PI / 8; // 22.5 degree rotation for octagon effect game.addChild(buttonShadow); menuElements.push(buttonShadow); // Main button body - octagonal shape var buttonBody = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 28, scaleY: 3.5, x: 1024, y: 2400 }); buttonBody.tint = 0x00BB00; buttonBody.rotation = Math.PI / 8; game.addChild(buttonBody); menuElements.push(buttonBody); // Top highlight for 3D effect var buttonTopHighlight = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 26, scaleY: 1.2, x: 1024, y: 2380 }); buttonTopHighlight.tint = 0x00FF00; buttonTopHighlight.alpha = 0.8; buttonTopHighlight.rotation = Math.PI / 8; game.addChild(buttonTopHighlight); menuElements.push(buttonTopHighlight); // Side panels for octagonal effect var leftPanel = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 3.5, scaleY: 20, x: 940, y: 2400 }); leftPanel.tint = 0x008800; leftPanel.rotation = Math.PI / 6; game.addChild(leftPanel); menuElements.push(leftPanel); var rightPanel = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 3.5, scaleY: 20, x: 1108, y: 2400 }); rightPanel.tint = 0x008800; rightPanel.rotation = -Math.PI / 6; game.addChild(rightPanel); menuElements.push(rightPanel); // Outer glow ring var glowRing = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 32, scaleY: 0.8, x: 1024, y: 2400 }); glowRing.tint = 0x44FF44; glowRing.alpha = 0.4; glowRing.rotation = Math.PI / 8; game.addChild(glowRing); menuElements.push(glowRing); // Inner energy core var energyCore = LK.getAsset('roadLine', { anchorX: 0.5, anchorY: 0.5, scaleX: 15, scaleY: 1.5, x: 1024, y: 2400 }); energyCore.tint = 0xAAFFAA; energyCore.alpha = 0.6; energyCore.rotation = Math.PI / 8; game.addChild(energyCore); menuElements.push(energyCore); // START text with premium styling var startButtonText = new Text2('START', { size: 120, fill: '#FFFFFF' }); startButtonText.anchor.set(0.5, 0.5); startButtonText.x = 1024; startButtonText.y = 2385; game.addChild(startButtonText); menuElements.push(startButtonText); // RACE text smaller underneath var raceText = new Text2('RACE', { size: 80, fill: '#CCFFCC' }); raceText.anchor.set(0.5, 0.5); raceText.x = 1024; raceText.y = 2425; game.addChild(raceText); menuElements.push(raceText); // Text glow effect var textGlow = new Text2('START', { size: 125, fill: '#88FF88' }); textGlow.anchor.set(0.5, 0.5); textGlow.x = 1024; textGlow.y = 2385; textGlow.alpha = 0.3; game.addChild(textGlow); menuElements.push(textGlow); // Store button references for animations var buttonElements = { body: buttonBody, highlight: buttonTopHighlight, leftPanel: leftPanel, rightPanel: rightPanel, glow: glowRing, core: energyCore, shadow: buttonShadow, text: startButtonText, race: raceText, textGlow: textGlow }; // Initialize selection visual state updateCarSelection(); // Simple animations - just gentle pulsing tween(titleText, { scaleX: 1.05, scaleY: 1.05 }, { duration: 2000, yoyo: true, repeat: -1 }); // Sophisticated octagonal button animations with depth and energy effects tween(buttonElements.body, { scaleX: 29, scaleY: 3.7, rotation: Math.PI / 8 + 0.05 }, { duration: 2000, yoyo: true, repeat: -1 }); tween(buttonElements.text, { scaleX: 1.08, scaleY: 1.08 }, { duration: 1800, yoyo: true, repeat: -1 }); tween(buttonElements.highlight, { alpha: 0.6, scaleX: 28, scaleY: 1.4 }, { duration: 1500, yoyo: true, repeat: -1 }); tween(buttonElements.glow, { alpha: 0.7, scaleX: 35, scaleY: 1.0 }, { duration: 1200, yoyo: true, repeat: -1 }); // Animate energy core with pulsing tween(buttonElements.core, { alpha: 0.9, scaleX: 18, scaleY: 2.0 }, { duration: 1000, yoyo: true, repeat: -1 }); // Side panel animations for dynamic effect tween(buttonElements.leftPanel, { rotation: Math.PI / 6 + 0.1, scaleY: 22 }, { duration: 1600, yoyo: true, repeat: -1 }); tween(buttonElements.rightPanel, { rotation: -Math.PI / 6 - 0.1, scaleY: 22 }, { duration: 1600, yoyo: true, repeat: -1 }); // Text glow pulsing tween(buttonElements.textGlow, { alpha: 0.6, scaleX: 1.02, scaleY: 1.02 }, { duration: 1400, yoyo: true, repeat: -1 }); // Shadow depth animation tween(buttonElements.shadow, { alpha: 0.9, scaleX: 32, scaleY: 4.2 }, { duration: 2200, yoyo: true, repeat: -1 }); // Race text subtle animation tween(buttonElements.race, { scaleX: 1.03, scaleY: 1.03, alpha: 0.9 }, { duration: 1900, yoyo: true, repeat: -1 }); } function removeStartMenu() { for (var i = 0; i < menuElements.length; i++) { menuElements[i].destroy(); } menuElements = []; } function startGame() { gameState = 'playing'; removeStartMenu(); loadBestScore(); initializeGameplay(); // Reset tap counter after starting game car1TapCount = 0; car2TapCount = 0; car3TapCount = 0; } function initializeGameplay() { // Initialize all game variables gameSpeed = 1; spawnTimer = 0; spawnRate = 120; lineSpawnTimer = 0; powerUpSpawnTimer = 0; nitroSpawnTimer = 0; cupSpawnTimer = 0; bomberSpawnTimer = 0; rampSpawnTimer = 0; playerJumping = false; jumpStartTime = 0; jumpHeight = 0; // Check if car1 was tapped 10 times for secret unlock if (selectedCarType === 0 && car1TapCount >= 10) { distanceTraveled = 2000; gameSpeed = 1 + distanceTraveled / 7000 + Math.pow(distanceTraveled / 15000, 1.5); gameSpeed = Math.min(gameSpeed, 4); // Flash screen to indicate secret unlock LK.effects.flashScreen(0x00ff00, 500); } else if (selectedCarType === 1 && car2TapCount >= 10) { // Trophy road mode - start with lots of trophies distanceTraveled = 0; // Flash screen golden to indicate trophy road LK.effects.flashScreen(0xFFD700, 1000); // Set flag for trophy road mode trophyRoadMode = true; } else { distanceTraveled = 0; } nitroEffect = false; nitroEndTime = 0; hasShield = false; trophyRoadMode = false; rapModeActive = false; rapModeTimer = 0; // Reset score LK.setScore(0); // Update UI texts with English scoreTxt.setText('Distance: ' + Math.floor(distanceTraveled)); bestScoreTxt.setText('Best: ' + bestDistance); speedTxt.setText('Speed: ' + gameSpeed.toFixed(1) + 'x'); // Reinitialize player car to ensure it's properly set up initializePlayerCar(); } // Initialize best score system loadBestScore(); // Create start menu on game load createStartMenu(); // Car selection variable var selectedCarType = 0; // 0 for PlayerCar, 1 for PlayerCar2, 2 for PlayerCar3 var playerCar; var selectionIndicator; var car1TapCount = 0; // Track taps on playercar1 for secret unlock var car2TapCount = 0; // Track taps on playercar2 for trophy road var car3TapCount = 0; // Track taps on playercar3 for secret message // Update car selection visual state function updateCarSelection() { if (selectionIndicator) { selectionIndicator.x = selectedCarType === 0 ? 624 : selectedCarType === 1 ? 1024 : 1424; } // Check if car 3 is unlocked var car3Unlocked = bestDistance >= 2000; // Update car button tints if they exist if (menuElements.length > 0) { for (var i = 0; i < menuElements.length; i++) { var element = menuElements[i]; if (element.x === 624 && element.y === 1650) { element.tint = selectedCarType === 0 ? 0xFFD700 : 0xFFFFFF; } else if (element.x === 1024 && element.y === 1650) { element.tint = selectedCarType === 1 ? 0xFFD700 : 0xFFFFFF; } else if (element.x === 1424 && element.y === 1650) { if (car3Unlocked) { element.tint = selectedCarType === 2 ? 0xFFD700 : 0xFFFFFF; } else { element.tint = 0x666666; // Gray out locked car element.alpha = 0.5; } } } } } // Initialize player car based on selection function initializePlayerCar() { if (playerCar) { playerCar.destroy(); } if (selectedCarType === 0) { playerCar = game.addChild(new PlayerCar()); } else if (selectedCarType === 1) { playerCar = game.addChild(new PlayerCar2()); } else { playerCar = game.addChild(new PlayerCar3()); } playerCar.x = 424 + 400; // Lane 1 playerCar.y = 2200; } // Initialize the first car initializePlayerCar(); var enemyCars = []; var powerUps = []; var roadLines = []; var nitros = []; var cups = []; var bombers = []; var bombs = []; var ramps = []; var playerJumping = false; var jumpStartTime = 0; var jumpDuration = 60; // 1 second at 60fps var jumpHeight = 0; var gameSpeed = 1; var spawnTimer = 0; var spawnRate = 120; var lineSpawnTimer = 0; var powerUpSpawnTimer = 0; var nitroSpawnTimer = 0; var cupSpawnTimer = 0; var bomberSpawnTimer = 0; var rampSpawnTimer = 0; var distanceTraveled = 0; var nitroEffect = false; var nitroEndTime = 0; var hasShield = false; var trophyRoadMode = false; var rapModeActive = false; var rapModeTimer = 0; var rapModeCheckInterval = 600; // Check every 10 seconds (600 ticks at 60fps) // Create initial road lines for (var i = 0; i < 20; i++) { for (var lane = 0; lane < 4; lane++) { var line = game.addChild(new RoadLine()); line.x = 624 + lane * 400; // Between lanes line.y = i * 150 - 200; roadLines.push(line); } } // UI Elements var scoreTxt = new Text2('Distance: 0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var bestScoreTxt = new Text2('Best: ' + bestDistance, { size: 60, fill: 0xFFD700 }); bestScoreTxt.anchor.set(0.5, 0); bestScoreTxt.y = 90; LK.gui.top.addChild(bestScoreTxt); var speedTxt = new Text2('Speed: 1x', { size: 60, fill: 0xFFFFFF }); speedTxt.anchor.set(1, 0); speedTxt.x = -20; speedTxt.y = 100; LK.gui.topRight.addChild(speedTxt); // Touch controls var touchStartX = 0; var touchStartTime = 0; game.down = function (x, y, obj) { if (gameState === 'menu') { // Check car selection buttons if (y >= 1050 && y <= 1250) { if (x >= 524 && x <= 724) { // Car 1 selected selectedCarType = 0; car1TapCount++; // Increment tap counter updateCarSelection(); initializePlayerCar(); return; } else if (x >= 924 && x <= 1124) { // Car 2 selected selectedCarType = 1; car2TapCount++; // Increment tap counter for car2 updateCarSelection(); initializePlayerCar(); return; } else if (x >= 1324 && x <= 1524) { // Car 3 selected - check if unlocked if (bestDistance >= 2000) { selectedCarType = 2; car3TapCount++; // Increment tap counter for car3 // Check if tapped 10 times for secret message if (car3TapCount >= 10) { // Display "Thank you Yavuz Abi" in score area scoreTxt.setText('Thank you Yavuz Abi'); // Flash screen to indicate special message LK.effects.flashScreen(0xFFD700, 1000); } updateCarSelection(); initializePlayerCar(); } else { // Car 3 is locked, flash red to indicate requirement LK.effects.flashScreen(0xff0000, 300); } return; } } // Check for start button tap at bottom - expanded touch area for better UX if (y >= 2150 && y <= 2650 && x >= 500 && x <= 1548) { startGame(); return; } } touchStartX = x; touchStartTime = LK.ticks; }; game.up = function (x, y, obj) { if (gameState !== 'playing') return; var touchEndX = x; var swipeDistance = touchEndX - touchStartX; var touchDuration = LK.ticks - touchStartTime; // Detect swipe or tap if (Math.abs(swipeDistance) > 100 && touchDuration < 30) { // Swipe detected if (swipeDistance > 0) { playerCar.switchLane(1); // Swipe right } else { playerCar.switchLane(-1); // Swipe left } } else if (touchDuration < 15) { // Quick tap - determine direction based on screen side if (x > 1024) { playerCar.switchLane(1); // Right side tap } else { playerCar.switchLane(-1); // Left side tap } } }; function spawnEnemyCar() { var lane = Math.floor(Math.random() * 4); var carTypes = ['enemyCar1', 'enemyCar2', 'enemyCar3']; var carType = carTypes[Math.floor(Math.random() * carTypes.length)]; var enemy = game.addChild(new EnemyCar(carType)); enemy.x = 424 + lane * 400; enemy.y = -100; enemy.lane = lane; enemy.speed = 8 * gameSpeed; enemyCars.push(enemy); } function spawnPowerUp() { // Reduce spawn chance as difficulty increases var spawnChance = Math.max(0.1, 0.3 - distanceTraveled / 25000); // Decreases from 30% to 10% if (Math.random() < spawnChance) { var lane = Math.floor(Math.random() * 4); var powerUp = game.addChild(new PowerUp()); powerUp.x = 424 + lane * 400; powerUp.y = -100; powerUp.speed = 8 * gameSpeed; powerUps.push(powerUp); } } function spawnNitro() { // Significantly reduce spawn chance as difficulty increases var spawnChance = Math.max(0.05, 0.2 - distanceTraveled / 20000); // Decreases from 20% to 5% if (Math.random() < spawnChance) { var lane = Math.floor(Math.random() * 4); var nitro = game.addChild(new Nitro()); nitro.x = 424 + lane * 400; nitro.y = -100; nitro.speed = 8 * gameSpeed; nitros.push(nitro); } } function spawnCup() { // Check if trophy road mode is active if (trophyRoadMode) { // In trophy road mode, spawn many cups (trophies) var spawnChance = 0.8; // Very high spawn chance for trophies if (Math.random() < spawnChance) { // Spawn multiple cups across different lanes for (var trophyLane = 0; trophyLane < 4; trophyLane++) { if (Math.random() < 0.7) { // 70% chance per lane var cup = game.addChild(new Cup()); cup.x = 424 + trophyLane * 400; cup.y = -100 - trophyLane * 150; // Stagger them vertically cup.speed = 8 * gameSpeed; cups.push(cup); } } } } else { // Normal spawn chance for cups var spawnChance = Math.max(0.03, 0.15 - distanceTraveled / 30000); // Decreases from 15% to 3% if (Math.random() < spawnChance) { var lane = Math.floor(Math.random() * 4); var cup = game.addChild(new Cup()); cup.x = 424 + lane * 400; cup.y = -100; cup.speed = 8 * gameSpeed; cups.push(cup); } } } function spawnRamp() { // Spawn ramps occasionally to help player jump over obstacles var spawnChance = Math.max(0.05, 0.15 - distanceTraveled / 20000); // Decreases from 15% to 5% if (Math.random() < spawnChance) { var lane = Math.floor(Math.random() * 4); var ramp = game.addChild(new Ramp()); ramp.x = 424 + lane * 400; ramp.y = -100; ramp.lane = lane; ramp.speed = 8 * gameSpeed; ramps.push(ramp); } } function spawnBomber() { // Moderate spawn chance for bombers var spawnChance = Math.max(0.08, 0.25 - distanceTraveled / 25000); // Decreases from 25% to 8% if (Math.random() < spawnChance) { var lane = Math.floor(Math.random() * 4); var bomber = game.addChild(new Bomber()); bomber.x = 424 + lane * 400; bomber.y = -100; bomber.lane = lane; bomber.speed = 6 * gameSpeed; bombers.push(bomber); } } game.update = function () { // Only update game logic when playing if (gameState !== 'playing') return; // Check for rap mode activation rapModeTimer++; if (rapModeTimer >= rapModeCheckInterval) { // 15% chance to activate rap mode every 10 seconds if (Math.random() < 0.15 && !rapModeActive) { rapModeActive = true; // Flash screen with hip-hop colors (purple/gold) LK.effects.flashScreen(0x9932CC, 800); // Change UI text to rap style scoreTxt.setText('Yo Distance: ' + Math.floor(distanceTraveled) + ' meters!'); speedTxt.setText('Speed Flow: ' + gameSpeed.toFixed(1) + 'x'); // Rap mode lasts for 5 seconds LK.setTimeout(function () { rapModeActive = false; // Reset UI text to normal scoreTxt.setText('Distance: ' + Math.floor(distanceTraveled)); speedTxt.setText('Speed: ' + gameSpeed.toFixed(1) + 'x'); LK.effects.flashScreen(0x00FFFF, 400); }, 5000); } rapModeTimer = 0; } // Update distance and speed with accelerated progression distanceTraveled += gameSpeed; var lastGameSpeed = gameSpeed; // More aggressive speed scaling for increased difficulty gameSpeed = 1 + distanceTraveled / 7000 + Math.pow(distanceTraveled / 15000, 1.5); gameSpeed = Math.min(gameSpeed, 4); // Cap maximum speed to keep game playable // Update UI text based on rap mode if (rapModeActive) { scoreTxt.setText('Yo Distance: ' + Math.floor(distanceTraveled) + ' meters!'); bestScoreTxt.setText('Best Flow: ' + bestDistance); speedTxt.setText('Speed Flow: ' + gameSpeed.toFixed(1) + 'x'); } else { scoreTxt.setText('Distance: ' + Math.floor(distanceTraveled)); bestScoreTxt.setText('Best: ' + bestDistance); speedTxt.setText('Speed: ' + gameSpeed.toFixed(1) + 'x'); } // Add pulsing effect when speed increases if (gameSpeed > lastGameSpeed + 0.1) { tween(speedTxt, { scaleX: 1.2, scaleY: 1.2 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { tween(speedTxt, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.easeIn }); } }); } // Spawn enemies with progressive difficulty spawnTimer++; var adjustedSpawnRate = Math.max(30, spawnRate - Math.floor(distanceTraveled / 500)); // More aggressive spawn rate reduction if (spawnTimer >= adjustedSpawnRate / gameSpeed) { spawnEnemyCar(); spawnTimer = 0; // Multiple enemy spawning at higher difficulty if (distanceTraveled > 5000 && Math.random() < 0.3) { spawnEnemyCar(); // 30% chance for double spawn after 5000 distance } if (distanceTraveled > 10000 && Math.random() < 0.2) { spawnEnemyCar(); // Additional spawn chance after 10000 distance } } // Spawn power-ups with reduced frequency at higher difficulty powerUpSpawnTimer++; var powerUpInterval = Math.max(200, 300 + Math.floor(distanceTraveled / 200)); // Longer intervals as distance increases if (powerUpSpawnTimer >= powerUpInterval / gameSpeed) { spawnPowerUp(); powerUpSpawnTimer = 0; } // Spawn nitro with increased rarity at higher difficulty nitroSpawnTimer++; var nitroInterval = Math.max(400, 600 + Math.floor(distanceTraveled / 150)); // Much longer intervals as distance increases if (nitroSpawnTimer >= nitroInterval / gameSpeed) { spawnNitro(); nitroSpawnTimer = 0; } // Spawn cups with very rare frequency cupSpawnTimer++; var cupInterval = Math.max(800, 1200 + Math.floor(distanceTraveled / 100)); // Very long intervals if (cupSpawnTimer >= cupInterval / gameSpeed) { spawnCup(); cupSpawnTimer = 0; } // Spawn bombers periodically bomberSpawnTimer++; var bomberInterval = Math.max(300, 500 + Math.floor(distanceTraveled / 200)); // Moderate intervals if (bomberSpawnTimer >= bomberInterval / gameSpeed) { spawnBomber(); bomberSpawnTimer = 0; } // Spawn ramps periodically rampSpawnTimer++; var rampInterval = Math.max(600, 800 + Math.floor(distanceTraveled / 300)); // Long intervals for ramps if (rampSpawnTimer >= rampInterval / gameSpeed) { spawnRamp(); rampSpawnTimer = 0; } // Check nitro effect end if (nitroEffect && LK.ticks >= nitroEndTime) { nitroEffect = false; tween(playerCar, { scaleX: 1, scaleY: 1 }, { duration: 300 }); } // Spawn road lines lineSpawnTimer++; if (lineSpawnTimer >= 25) { for (var lane = 0; lane < 4; lane++) { var line = game.addChild(new RoadLine()); line.x = 624 + lane * 400; line.y = -100; line.speed = 8 * gameSpeed; roadLines.push(line); } lineSpawnTimer = 0; } // Update and check power-ups for (var j = powerUps.length - 1; j >= 0; j--) { var powerUp = powerUps[j]; // Remove off-screen power-ups if (powerUp.y > 2800) { powerUp.destroy(); powerUps.splice(j, 1); continue; } // Check collection if (powerUp.intersects(playerCar)) { LK.setScore(LK.getScore() + 50); LK.getSound('collect').play(); LK.effects.flashObject(powerUp, 0xffffff, 200); // Add smooth scale-out effect before destroying tween(powerUp, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 200, onFinish: function onFinish() { powerUp.destroy(); } }); powerUps.splice(j, 1); } } // Update and check nitros for (var n = nitros.length - 1; n >= 0; n--) { var nitro = nitros[n]; // Remove off-screen nitros if (nitro.y > 2800) { nitro.destroy(); nitros.splice(n, 1); continue; } // Check collection if (nitro.intersects(playerCar)) { LK.setScore(LK.getScore() + 100); LK.getSound('collect').play(); // Activate nitro effect nitroEffect = true; nitroEndTime = LK.ticks + 300; // 5 seconds at 60fps tween(playerCar, { scaleX: 1.3, scaleY: 1.3 }, { duration: 300 }); LK.effects.flashScreen(0x00ff00, 500); // Add smooth scale-out effect for nitro tween(nitro, { scaleX: 3, scaleY: 3, alpha: 0 }, { duration: 400, easing: tween.elasticOut, onFinish: function onFinish() { nitro.destroy(); } }); nitros.splice(n, 1); } } // Update and check cups for (var c = cups.length - 1; c >= 0; c--) { var cup = cups[c]; // Remove off-screen cups if (cup.y > 2800) { cup.destroy(); cups.splice(c, 1); continue; } // Check collection if (cup.intersects(playerCar)) { hasShield = true; LK.setScore(LK.getScore() + 150); LK.getSound('collect').play(); LK.effects.flashScreen(0xFFD700, 400); // Visual feedback for shield activation tween(playerCar, { tint: 0xFFD700 }, { duration: 200, onFinish: function onFinish() { tween(playerCar, { tint: 0xFFFFFF }, { duration: 200 }); } }); // Add smooth scale-out effect for cup tween(cup, { scaleX: 3, scaleY: 3, alpha: 0 }, { duration: 300, easing: tween.elasticOut, onFinish: function onFinish() { cup.destroy(); } }); cups.splice(c, 1); } } // Update and check bombers for (var b = bombers.length - 1; b >= 0; b--) { var bomber = bombers[b]; // Remove off-screen bombers if (bomber.y > 2800) { bomber.destroy(); bombers.splice(b, 1); continue; } // Check collision with player if (bomber.intersects(playerCar)) { // Always crush/kill the bomber person on collision LK.setScore(LK.getScore() + 300); LK.getSound('collect').play(); LK.effects.flashScreen(0x00ff00, 300); // Create explosion at bomber position var explosion = game.addChild(new Explosion()); explosion.x = bomber.x; explosion.y = bomber.y; // Destroy the bomber bomber.destroy(); bombers.splice(b, 1); continue; } } // Update and check bombs for (var bomb = bombs.length - 1; bomb >= 0; bomb--) { var bombObj = bombs[bomb]; // Remove off-screen bombs if (bombObj.y > 2800) { bombObj.destroy(); bombs.splice(bomb, 1); continue; } // Check collision with player if (bombObj.intersects(playerCar)) { if (hasShield) { // Player has shield from cup - destroy bomb instead hasShield = false; LK.setScore(LK.getScore() + 200); LK.getSound('collect').play(); LK.effects.flashScreen(0x00ff00, 300); // Create explosion at bomb position var explosion = game.addChild(new Explosion()); explosion.x = bombObj.x; explosion.y = bombObj.y; // Destroy the bomb bombObj.destroy(); bombs.splice(bomb, 1); continue; } else { // Normal collision - game over with bigger explosion var explosion = game.addChild(new Explosion()); explosion.x = playerCar.x; explosion.y = playerCar.y; // Create additional explosion for bomb impact var bombExplosion = game.addChild(new Explosion()); bombExplosion.x = bombObj.x; bombExplosion.y = bombObj.y; tween(playerCar, { scaleX: 0, scaleY: 0, rotation: Math.PI * 2, alpha: 0 }, { duration: 500, easing: tween.easeOut }); if (distanceTraveled > bestDistance) { bestDistance = Math.floor(distanceTraveled); bestScoreTxt.setText('Best: ' + bestDistance); saveBestScore(); } LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } } // Update and check ramps for (var r = ramps.length - 1; r >= 0; r--) { var ramp = ramps[r]; // Remove off-screen ramps if (ramp.y > 2800) { ramp.destroy(); ramps.splice(r, 1); continue; } // Check if player hits ramp to initiate jump if (ramp.intersects(playerCar) && !playerJumping) { playerJumping = true; jumpStartTime = LK.ticks; LK.setScore(LK.getScore() + 75); // Bonus for using ramp LK.getSound('collect').play(); // Flash effect for ramp activation LK.effects.flashScreen(0x00AAFF, 300); // Scale out ramp effect tween(ramp, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 400, onFinish: function onFinish() { ramp.destroy(); } }); ramps.splice(r, 1); continue; } } // Collision detection with enemies - skip if jumping high enough for (var i = enemyCars.length - 1; i >= 0; i--) { var enemy = enemyCars[i]; if (enemy.lastY === undefined) enemy.lastY = enemy.y; // Remove off-screen enemies if (enemy.lastY < 2800 && enemy.y >= 2800) { enemy.destroy(); enemyCars.splice(i, 1); continue; } // Check collision with player - but not if jumping high enough if (enemy.intersects(playerCar) && (!playerJumping || jumpHeight < 50)) { if (hasShield) { // Player has shield from cup - destroy enemy instead hasShield = false; LK.setScore(LK.getScore() + 200); LK.getSound('collect').play(); LK.effects.flashScreen(0x00ff00, 300); // Create explosion at enemy position var explosion = game.addChild(new Explosion()); explosion.x = enemy.x; explosion.y = enemy.y; // Destroy the enemy enemy.destroy(); enemyCars.splice(i, 1); continue; } else { // Normal collision - game over // Create explosion at collision point var explosion = game.addChild(new Explosion()); explosion.x = playerCar.x; explosion.y = playerCar.y; // Make player car explode with tween effect tween(playerCar, { scaleX: 0, scaleY: 0, rotation: Math.PI * 2, alpha: 0 }, { duration: 500, easing: tween.easeOut }); // Update best score if needed if (distanceTraveled > bestDistance) { bestDistance = Math.floor(distanceTraveled); bestScoreTxt.setText('Best: ' + bestDistance); saveBestScore(); } LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } else if (playerJumping && jumpHeight >= 50) { // Player jumped over enemy - bonus points! if (!enemy.jumpedOver) { LK.setScore(LK.getScore() + 150); LK.getSound('dodge').play(); enemy.jumpedOver = true; // Mark to prevent multiple bonuses } } // Check for near miss (score bonus) var distanceFromPlayer = Math.abs(enemy.x - playerCar.x); if (enemy.y > playerCar.y - 150 && enemy.y < playerCar.y + 150 && distanceFromPlayer < 200 && distanceFromPlayer > 150) { if (!enemy.nearMissScored) { LK.setScore(LK.getScore() + 10); LK.getSound('dodge').play(); enemy.nearMissScored = true; } } enemy.lastY = enemy.y; } // Update road lines for (var k = roadLines.length - 1; k >= 0; k--) { var line = roadLines[k]; // Remove off-screen lines if (line.y > 2800) { line.destroy(); roadLines.splice(k, 1); } } };
===================================================================
--- original.js
+++ change.js
@@ -559,78 +559,147 @@
instructionsText.x = 1024;
instructionsText.y = 1450;
game.addChild(instructionsText);
menuElements.push(instructionsText);
- // START BUTTON AT BOTTOM - large and prominent with modern design
- // Create button background using multiple layered elements for depth
- var startButtonShadow = LK.getAsset('enemyCar3', {
+ // START BUTTON AT BOTTOM - modern octagonal design with depth and glow
+ // Create octagonal button base using multiple elements
+ var buttonShadow = LK.getAsset('roadLine', {
anchorX: 0.5,
anchorY: 0.5,
- scaleX: 6.2,
- scaleY: 1.7,
+ scaleX: 30,
+ scaleY: 4,
x: 1024,
- y: 2410
+ y: 2415
});
- startButtonShadow.tint = 0x002200;
- startButtonShadow.alpha = 0.6;
- game.addChild(startButtonShadow);
- menuElements.push(startButtonShadow);
- var startButtonBg = LK.getAsset('enemyCar3', {
+ buttonShadow.tint = 0x001100;
+ buttonShadow.alpha = 0.7;
+ buttonShadow.rotation = Math.PI / 8; // 22.5 degree rotation for octagon effect
+ game.addChild(buttonShadow);
+ menuElements.push(buttonShadow);
+ // Main button body - octagonal shape
+ var buttonBody = LK.getAsset('roadLine', {
anchorX: 0.5,
anchorY: 0.5,
- scaleX: 6,
- scaleY: 1.5,
+ scaleX: 28,
+ scaleY: 3.5,
x: 1024,
y: 2400
});
- startButtonBg.tint = 0x00DD00;
- game.addChild(startButtonBg);
- menuElements.push(startButtonBg);
- // Add button highlight for premium look
- var startButtonHighlight = LK.getAsset('roadLine', {
+ buttonBody.tint = 0x00BB00;
+ buttonBody.rotation = Math.PI / 8;
+ game.addChild(buttonBody);
+ menuElements.push(buttonBody);
+ // Top highlight for 3D effect
+ var buttonTopHighlight = LK.getAsset('roadLine', {
anchorX: 0.5,
anchorY: 0.5,
- scaleX: 20,
- scaleY: 0.5,
+ scaleX: 26,
+ scaleY: 1.2,
x: 1024,
- y: 2350
+ y: 2380
});
- startButtonHighlight.tint = 0x88FF88;
- startButtonHighlight.alpha = 0.8;
- game.addChild(startButtonHighlight);
- menuElements.push(startButtonHighlight);
- // Add button border for definition
- var startButtonBorder = LK.getAsset('roadLine', {
+ buttonTopHighlight.tint = 0x00FF00;
+ buttonTopHighlight.alpha = 0.8;
+ buttonTopHighlight.rotation = Math.PI / 8;
+ game.addChild(buttonTopHighlight);
+ menuElements.push(buttonTopHighlight);
+ // Side panels for octagonal effect
+ var leftPanel = LK.getAsset('roadLine', {
anchorX: 0.5,
anchorY: 0.5,
- scaleX: 24,
- scaleY: 0.3,
+ scaleX: 3.5,
+ scaleY: 20,
+ x: 940,
+ y: 2400
+ });
+ leftPanel.tint = 0x008800;
+ leftPanel.rotation = Math.PI / 6;
+ game.addChild(leftPanel);
+ menuElements.push(leftPanel);
+ var rightPanel = LK.getAsset('roadLine', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 3.5,
+ scaleY: 20,
+ x: 1108,
+ y: 2400
+ });
+ rightPanel.tint = 0x008800;
+ rightPanel.rotation = -Math.PI / 6;
+ game.addChild(rightPanel);
+ menuElements.push(rightPanel);
+ // Outer glow ring
+ var glowRing = LK.getAsset('roadLine', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 32,
+ scaleY: 0.8,
x: 1024,
- y: 2450
+ y: 2400
});
- startButtonBorder.tint = 0x004400;
- game.addChild(startButtonBorder);
- menuElements.push(startButtonBorder);
- var startButtonText = new Text2('START RACE', {
- size: 110,
+ glowRing.tint = 0x44FF44;
+ glowRing.alpha = 0.4;
+ glowRing.rotation = Math.PI / 8;
+ game.addChild(glowRing);
+ menuElements.push(glowRing);
+ // Inner energy core
+ var energyCore = LK.getAsset('roadLine', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 15,
+ scaleY: 1.5,
+ x: 1024,
+ y: 2400
+ });
+ energyCore.tint = 0xAAFFAA;
+ energyCore.alpha = 0.6;
+ energyCore.rotation = Math.PI / 8;
+ game.addChild(energyCore);
+ menuElements.push(energyCore);
+ // START text with premium styling
+ var startButtonText = new Text2('START', {
+ size: 120,
fill: '#FFFFFF'
});
startButtonText.anchor.set(0.5, 0.5);
startButtonText.x = 1024;
- startButtonText.y = 2400;
+ startButtonText.y = 2385;
game.addChild(startButtonText);
menuElements.push(startButtonText);
- // Add subtle glow text effect
- var startButtonGlow = new Text2('START RACE', {
- size: 115,
+ // RACE text smaller underneath
+ var raceText = new Text2('RACE', {
+ size: 80,
+ fill: '#CCFFCC'
+ });
+ raceText.anchor.set(0.5, 0.5);
+ raceText.x = 1024;
+ raceText.y = 2425;
+ game.addChild(raceText);
+ menuElements.push(raceText);
+ // Text glow effect
+ var textGlow = new Text2('START', {
+ size: 125,
fill: '#88FF88'
});
- startButtonGlow.anchor.set(0.5, 0.5);
- startButtonGlow.x = 1024;
- startButtonGlow.y = 2400;
- startButtonGlow.alpha = 0.3;
- game.addChild(startButtonGlow);
- menuElements.push(startButtonGlow);
+ textGlow.anchor.set(0.5, 0.5);
+ textGlow.x = 1024;
+ textGlow.y = 2385;
+ textGlow.alpha = 0.3;
+ game.addChild(textGlow);
+ menuElements.push(textGlow);
+ // Store button references for animations
+ var buttonElements = {
+ body: buttonBody,
+ highlight: buttonTopHighlight,
+ leftPanel: leftPanel,
+ rightPanel: rightPanel,
+ glow: glowRing,
+ core: energyCore,
+ shadow: buttonShadow,
+ text: startButtonText,
+ race: raceText,
+ textGlow: textGlow
+ };
// Initialize selection visual state
updateCarSelection();
// Simple animations - just gentle pulsing
tween(titleText, {
@@ -640,52 +709,101 @@
duration: 2000,
yoyo: true,
repeat: -1
});
- // Sophisticated button animations with multiple elements
- tween(startButtonBg, {
- scaleX: 6.1,
- scaleY: 1.55
+ // Sophisticated octagonal button animations with depth and energy effects
+ tween(buttonElements.body, {
+ scaleX: 29,
+ scaleY: 3.7,
+ rotation: Math.PI / 8 + 0.05
}, {
+ duration: 2000,
+ yoyo: true,
+ repeat: -1
+ });
+ tween(buttonElements.text, {
+ scaleX: 1.08,
+ scaleY: 1.08
+ }, {
duration: 1800,
yoyo: true,
repeat: -1
});
- tween(startButtonText, {
- scaleX: 1.05,
- scaleY: 1.05
+ tween(buttonElements.highlight, {
+ alpha: 0.6,
+ scaleX: 28,
+ scaleY: 1.4
}, {
- duration: 2000,
+ duration: 1500,
yoyo: true,
repeat: -1
});
- tween(startButtonHighlight, {
- alpha: 0.4,
- scaleX: 22
+ tween(buttonElements.glow, {
+ alpha: 0.7,
+ scaleX: 35,
+ scaleY: 1.0
}, {
+ duration: 1200,
+ yoyo: true,
+ repeat: -1
+ });
+ // Animate energy core with pulsing
+ tween(buttonElements.core, {
+ alpha: 0.9,
+ scaleX: 18,
+ scaleY: 2.0
+ }, {
+ duration: 1000,
+ yoyo: true,
+ repeat: -1
+ });
+ // Side panel animations for dynamic effect
+ tween(buttonElements.leftPanel, {
+ rotation: Math.PI / 6 + 0.1,
+ scaleY: 22
+ }, {
duration: 1600,
yoyo: true,
repeat: -1
});
- tween(startButtonGlow, {
+ tween(buttonElements.rightPanel, {
+ rotation: -Math.PI / 6 - 0.1,
+ scaleY: 22
+ }, {
+ duration: 1600,
+ yoyo: true,
+ repeat: -1
+ });
+ // Text glow pulsing
+ tween(buttonElements.textGlow, {
alpha: 0.6,
- scaleX: 1.03,
- scaleY: 1.03
+ scaleX: 1.02,
+ scaleY: 1.02
}, {
duration: 1400,
yoyo: true,
repeat: -1
});
- // Add subtle pulsing to shadow for depth
- tween(startButtonShadow, {
- alpha: 0.8,
- scaleX: 6.3,
- scaleY: 1.75
+ // Shadow depth animation
+ tween(buttonElements.shadow, {
+ alpha: 0.9,
+ scaleX: 32,
+ scaleY: 4.2
}, {
duration: 2200,
yoyo: true,
repeat: -1
});
+ // Race text subtle animation
+ tween(buttonElements.race, {
+ scaleX: 1.03,
+ scaleY: 1.03,
+ alpha: 0.9
+ }, {
+ duration: 1900,
+ yoyo: true,
+ repeat: -1
+ });
}
function removeStartMenu() {
for (var i = 0; i < menuElements.length; i++) {
menuElements[i].destroy();
pixel art ferrari bird's eye view. In-Game asset. 2d. High contrast. No shadows
pixel art tofaş bird's eye view. In-Game asset. 2d. High contrast. No shadows
pixel art Togg bird's eye view. In-Game asset. 2d. High contrast. No shadows
pixel art gas pedal bird's eye view. In-Game asset. 2d. High contrast. No shadows
pixel art nitro. In-Game asset. 2d. High contrast. No shadows
pixel art fantasy car bird's eye view. In-Game asset. 2d. High contrast. No shadows
pixel art straight line,. In-Game asset. 2d. High contrast. No shadows
Gold and Glory pixel art cup. In-Game asset. 2d. High contrast. No shadows
bugatti bolide pixel art bird's eye view. In-Game asset. 2d. High contrast. No shadows
BMW X6 pixel art bird's eye view. In-Game asset. 2d. High contrast. No shadows
pixel art joker. In-Game asset. 2d. High contrast. No shadows
düz sarı çizgi. In-Game asset. 2d. High contrast. No shadows
pixel art peter parker. In-Game asset. 2d. High contrast. No shadows
bird's eye pixel art motorcycle suzuki. In-Game asset. 2d. High contrast. No shadows