User prompt
yüklediğim müziği arka planda çal. eğer müzik biterse sonsuz olarak çalmaya devam et
User prompt
Ana menüde müzik ayarı butonu bulunmalı ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
varlıklar birbirine karışmaz
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var localPos = self.toLocal(obj.parent.toGlobal(obj.position));' Line Number: 157
User prompt
Ana Menü olmalı. oyun 50 sviyeden oluşmakta. oyuncu 1.levelde 25 zümrüt toplarsa 2.levelin anahtarı açılır. 2.levelde 50 zümrüt toplarsa 3.levelin anahtarı açılır bu şekilde 50.levele kadar 25 er 25 er arttırarak oyunu kazanır. her level sonu kutlama efekti olur. ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
skor sistemi olarak sağ üst köşede Emerald yazmalı ve oyuncu zümrüt toplayınca ne kadar zümrüt topladığı orada görünmeli
User prompt
distance yazısı silinmeli
User prompt
coins yazısı silinsin score yazısı silinsin
User prompt
çnceki iki komutu sil
User prompt
İnroda video olmalı karakterimiz bir suç işlemiş ve kaçması gerek fakat bunu yaparken de mücevherlere ihtiyacı varmış bunu anlatan bir tanıtım videosu olmalı
User prompt
Oyun başlamadan önce oyunu anlatan bir intro olmalı
User prompt
varlıklar birbirine karışmaz
User prompt
oyuncu engellerin üzerinden atlarken hemen yanmaması için yer çekimi yavaşlayabilir ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyuncu engellerin üzerinden atlayabilir daha yukarıya ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyuncu engellerin üzerinden engeli aşabilecek boyutta atlayabilr
User prompt
oyuncu engellerin üzerinden atlayabilir
User prompt
coinler trenin üstünden gelmemel assetler birbirine karışmasın
User prompt
arka plan mavi değil siyah olmalı
Code edit (1 edits merged)
Please save this source code
User prompt
Subway Runner - Endless City Chase
Initial prompt
Merhaba Ava, Subway Surfers oyunu yapmak istiyorum. intro ekranı olmalı ve bu ekranda kolay orta ve zor mod yer almalı oyuncu hangi seviyede oynamak istediğine tıklar karşısına yeni ekran gelir bu ekranda oyuna başla butonu vardır oyuncu tıklarsa oyun başlar ve subway surfers başlamış olur.
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var facekit = LK.import("@upit/facekit.v1"); /**** * Classes ****/ var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); self.speed = gameSpeed; self.collected = false; self.update = function () { self.y += self.speed; coinGraphics.rotation += 0.1; }; return self; }); var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 1.0 }); self.speed = gameSpeed; self.update = function () { self.y += self.speed; }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 1.0 }); self.lane = 1; // 0=left, 1=center, 2=right self.isJumping = false; self.isSliding = false; self.jumpStartY = 0; self.slideTimer = 0; self.update = function () { // Handle jumping if (self.isJumping) { var jumpProgress = (LK.ticks - self.jumpStartTick) / 45; // Slower jump duration for longer air time if (jumpProgress >= 1) { self.isJumping = false; self.y = self.jumpStartY; } else { var jumpHeight = Math.sin(jumpProgress * Math.PI) * 400; self.y = self.jumpStartY - jumpHeight; } } // Handle sliding if (self.isSliding) { self.slideTimer--; if (self.slideTimer <= 0) { self.isSliding = false; playerGraphics.scaleY = 1.0; } } // Update lane position var targetX = 512 + self.lane * 512; self.x += (targetX - self.x) * 0.2; }; self.jump = function () { if (!self.isJumping && !self.isSliding) { self.isJumping = true; self.jumpStartY = self.y; self.jumpStartTick = LK.ticks; LK.getSound('jump').play(); // Add tween for smoother jump animation tween(self, { scaleX: 1.2, scaleY: 0.8 }, { duration: 150, easing: tween.easeOut, onFinish: function onFinish() { tween(self, { scaleX: 1.0, scaleY: 1.0 }, { duration: 600, easing: tween.easeOut // Slower landing for gravity effect }); } }); } }; self.slide = function () { if (!self.isJumping && !self.isSliding) { self.isSliding = true; self.slideTimer = 30; playerGraphics.scaleY = 0.5; } }; self.moveLeft = function () { if (self.lane > 0) { self.lane--; } }; self.moveRight = function () { if (self.lane < 2) { self.lane++; } }; self.isHighEnoughToClear = function () { if (!self.isJumping) return false; var jumpProgress = (LK.ticks - self.jumpStartTick) / 45; // Match slower gravity timing var jumpHeight = Math.sin(jumpProgress * Math.PI) * 400; return jumpHeight > 120; // Player needs to be at least 120 pixels high to clear obstacles }; return self; }); var Track = Container.expand(function () { var self = Container.call(this); var trackGraphics = self.attachAsset('track', { anchorX: 0.5, anchorY: 0.5 }); self.speed = gameSpeed; self.update = function () { self.y += self.speed; }; return self; }); var Train = Container.expand(function () { var self = Container.call(this); var trainGraphics = self.attachAsset('train', { anchorX: 0.5, anchorY: 1.0 }); self.speed = gameSpeed; self.update = function () { self.y += self.speed; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var gameSpeed = 8; var difficulty = 'medium'; var obstacleSpawnRate = 120; var coinSpawnRate = 60; var distance = 0; var coins = 0; var player; var obstacles = []; var trains = []; var coinsList = []; var tracks = []; var lastSwipeX = 0; var lastSwipeY = 0; var swipeStartX = 0; var swipeStartY = 0; var isSwipeStarted = false; // Initialize tracks for visual effect for (var i = 0; i < 5; i++) { var track = new Track(); track.x = 1024; track.y = i * 200 - 200; tracks.push(track); game.addChild(track); } // Initialize player player = new Player(); player.x = 1024; player.y = 2200; game.addChild(player); // UI Elements var scoreText = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(0, 0); scoreText.x = 120; scoreText.y = 50; LK.gui.addChild(scoreText); var coinsText = new Text2('Coins: 0', { size: 60, fill: 0xFFD700 }); coinsText.anchor.set(1, 0); coinsText.x = LK.gui.width - 50; coinsText.y = 50; LK.gui.addChild(coinsText); var distanceText = new Text2('Distance: 0m', { size: 50, fill: 0xFFFFFF }); distanceText.anchor.set(0.5, 0); distanceText.x = LK.gui.width / 2; distanceText.y = 50; LK.gui.addChild(distanceText); // Set difficulty based on game design function setDifficulty(diff) { difficulty = diff; switch (diff) { case 'easy': gameSpeed = 6; obstacleSpawnRate = 150; coinSpawnRate = 45; break; case 'medium': gameSpeed = 8; obstacleSpawnRate = 120; coinSpawnRate = 60; break; case 'hard': gameSpeed = 12; obstacleSpawnRate = 90; coinSpawnRate = 80; break; } } // Set default difficulty setDifficulty('medium'); // Handle swipe controls game.down = function (x, y, obj) { // Only handle swipes during gameplay if (gameState !== 'playing') { return; } swipeStartX = x; swipeStartY = y; isSwipeStarted = true; }; game.up = function (x, y, obj) { // Only handle swipes during gameplay if (gameState !== 'playing') { return; } if (!isSwipeStarted) return; var deltaX = x - swipeStartX; var deltaY = y - swipeStartY; var swipeThreshold = 50; if (Math.abs(deltaX) > Math.abs(deltaY)) { // Horizontal swipe if (Math.abs(deltaX) > swipeThreshold) { if (deltaX > 0) { player.moveRight(); } else { player.moveLeft(); } } } else { // Vertical swipe if (Math.abs(deltaY) > swipeThreshold) { if (deltaY < 0) { player.jump(); } else { player.slide(); } } } isSwipeStarted = false; }; // Spawn obstacles function spawnObstacle() { var availableLanes = [0, 1, 2]; // Remove lanes that already have obstacles in extended spawn area for (var i = obstacles.length - 1; i >= 0; i--) { var obstacle = obstacles[i]; if (obstacle.y >= -600 && obstacle.y <= 400) { // Obstacle in extended spawn area var obstacleLaneIndex = availableLanes.indexOf(obstacle.lane); if (obstacleLaneIndex > -1) { availableLanes.splice(obstacleLaneIndex, 1); } } } // Remove lanes that already have trains in extended spawn area for (var i = trains.length - 1; i >= 0; i--) { var train = trains[i]; if (train.y >= -600 && train.y <= 400) { // Train in extended spawn area var trainLaneIndex = availableLanes.indexOf(train.lane); if (trainLaneIndex > -1) { availableLanes.splice(trainLaneIndex, 1); } } } // Remove lanes that have coins in spawn area to prevent overlap for (var i = coinsList.length - 1; i >= 0; i--) { var coin = coinsList[i]; if (coin.y >= -400 && coin.y <= 200) { // Coin in spawn area var coinLaneIndex = availableLanes.indexOf(coin.lane); if (coinLaneIndex > -1) { availableLanes.splice(coinLaneIndex, 1); } } } // If no lanes available, don't spawn obstacle if (availableLanes.length === 0) { return; } var lane = availableLanes[Math.floor(Math.random() * availableLanes.length)]; var obstacleType = Math.random(); if (obstacleType < 0.6) { // Regular obstacle var obstacle = new Obstacle(); obstacle.x = 512 + lane * 512; obstacle.y = -100; obstacle.lane = lane; obstacles.push(obstacle); game.addChild(obstacle); } else { // Train var train = new Train(); train.x = 512 + lane * 512; train.y = -150; train.lane = lane; trains.push(train); game.addChild(train); } } // Spawn coins function spawnCoin() { var availableLanes = [0, 1, 2]; // Remove lanes that have trains in spawn area for (var i = trains.length - 1; i >= 0; i--) { var train = trains[i]; if (train.y >= -600 && train.y <= 200) { // Train in spawn area var trainLaneIndex = availableLanes.indexOf(train.lane); if (trainLaneIndex > -1) { availableLanes.splice(trainLaneIndex, 1); } } } // Remove lanes that have obstacles in spawn area for (var i = obstacles.length - 1; i >= 0; i--) { var obstacle = obstacles[i]; if (obstacle.y >= -400 && obstacle.y <= 200) { // Obstacle in spawn area var obstacleLaneIndex = availableLanes.indexOf(obstacle.lane); if (obstacleLaneIndex > -1) { availableLanes.splice(obstacleLaneIndex, 1); } } } // Remove lanes that already have coins in spawn area for (var i = coinsList.length - 1; i >= 0; i--) { var coin = coinsList[i]; if (coin.y >= -400 && coin.y <= 200) { // Coin in spawn area var coinLaneIndex = availableLanes.indexOf(coin.lane); if (coinLaneIndex > -1) { availableLanes.splice(coinLaneIndex, 1); } } } // If no lanes available, don't spawn coin if (availableLanes.length === 0) { return; } var lane = availableLanes[Math.floor(Math.random() * availableLanes.length)]; var coin = new Coin(); coin.x = 512 + lane * 512; coin.y = -50; coin.lane = lane; coinsList.push(coin); game.addChild(coin); } // Check collisions function checkCollisions() { // Check obstacle collisions for (var i = obstacles.length - 1; i >= 0; i--) { var obstacle = obstacles[i]; if (obstacle.lane === player.lane) { if (Math.abs(obstacle.y - player.y) < 80) { // Check if player can clear obstacle by jumping if (!player.isJumping || !player.isHighEnoughToClear()) { // Collision detected LK.showGameOver(); return; } } } } // Check train collisions for (var i = trains.length - 1; i >= 0; i--) { var train = trains[i]; if (train.lane === player.lane) { if (Math.abs(train.y - player.y) < 90) { // Check if player can clear train by jumping if (!player.isJumping || !player.isHighEnoughToClear()) { // Collision detected LK.showGameOver(); return; } } } } // Check coin collection for (var i = coinsList.length - 1; i >= 0; i--) { var coin = coinsList[i]; if (!coin.collected && coin.lane === player.lane) { if (Math.abs(coin.y - player.y) < 60) { coin.collected = true; coins++; LK.setScore(LK.getScore() + 10); LK.getSound('collect').play(); coin.destroy(); coinsList.splice(i, 1); } } } } // Clean up off-screen objects function cleanupObjects() { // Clean obstacles for (var i = obstacles.length - 1; i >= 0; i--) { if (obstacles[i].y > 2800) { obstacles[i].destroy(); obstacles.splice(i, 1); } } // Clean trains for (var i = trains.length - 1; i >= 0; i--) { if (trains[i].y > 2800) { trains[i].destroy(); trains.splice(i, 1); } } // Clean coins for (var i = coinsList.length - 1; i >= 0; i--) { if (coinsList[i].y > 2800) { coinsList[i].destroy(); coinsList.splice(i, 1); } } // Reset tracks for (var i = 0; i < tracks.length; i++) { if (tracks[i].y > 2800) { tracks[i].y = -200; } } } // Update UI function updateUI() { distance = Math.floor(LK.ticks / 6); scoreText.setText('Score: ' + LK.getScore()); coinsText.setText('Coins: ' + coins); distanceText.setText('Distance: ' + distance + 'm'); } // Main game update game.update = function () { // Only update game when in playing state if (gameState !== 'playing') { return; } // Update speed over time gameSpeed = Math.min(15, 8 + LK.ticks / 1800); // Spawn obstacles if (LK.ticks % obstacleSpawnRate === 0) { spawnObstacle(); } // Spawn coins if (LK.ticks % coinSpawnRate === 0) { spawnCoin(); } // Update score based on distance if (LK.ticks % 6 === 0) { LK.setScore(LK.getScore() + 1); } // Check collisions checkCollisions(); // Clean up objects cleanupObjects(); // Update UI updateUI(); }; // Game state management var gameState = 'intro'; // 'intro', 'playing' var introScreen; var introTitle; var introInstructions; var startButton; // Create intro screen function createIntroScreen() { introScreen = new Container(); // Background overlay var overlay = LK.getAsset('barrier', { anchorX: 0.5, anchorY: 0.5, scaleX: 6, scaleY: 15, tint: 0x000000, alpha: 0.9 }); overlay.x = 1024; overlay.y = 1366; introScreen.addChild(overlay); // Initialize camera for video background facekit.initCamera(); // Story sequence variables var storyStep = 0; var storyTimer = 0; var storyElements = []; // Create story elements var criminal = LK.getAsset('criminal', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); criminal.x = 1024; criminal.y = 1000; criminal.alpha = 0; var jewel = LK.getAsset('jewel', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2 }); jewel.x = 1024; jewel.y = 800; jewel.alpha = 0; var police = LK.getAsset('police', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.2, scaleY: 1.2 }); police.x = 1024; police.y = 1200; police.alpha = 0; storyElements.push(criminal, jewel, police); introScreen.addChild(criminal); introScreen.addChild(jewel); introScreen.addChild(police); // Story text var storyText = new Text2('', { size: 80, fill: 0xFFFFFF }); storyText.anchor.set(0.5, 0.5); storyText.x = 1024; storyText.y = 1600; introScreen.addChild(storyText); // Story update function function updateStory() { storyTimer++; switch (storyStep) { case 0: // Show criminal if (storyTimer === 1) { storyText.setText('Our hero committed a crime...'); tween(criminal, { alpha: 1 }, { duration: 1000 }); } if (storyTimer === 120) { storyStep++; storyTimer = 0; } break; case 1: // Show jewels if (storyTimer === 1) { storyText.setText('But he needs precious jewels to escape!'); tween(jewel, { alpha: 1 }, { duration: 1000 }); tween(jewel, { rotation: Math.PI * 2 }, { duration: 2000, loop: true }); } if (storyTimer === 120) { storyStep++; storyTimer = 0; } break; case 2: // Show police if (storyTimer === 1) { storyText.setText('The police are chasing him!'); tween(police, { alpha: 1 }, { duration: 1000 }); } if (storyTimer === 120) { storyStep++; storyTimer = 0; } break; case 3: // Final message if (storyTimer === 1) { storyText.setText('Help him escape and collect jewels!'); // Hide story elements tween(criminal, { alpha: 0 }, { duration: 1000 }); tween(jewel, { alpha: 0 }, { duration: 1000 }); tween(police, { alpha: 0 }, { duration: 1000 }); } if (storyTimer === 90) { showGameInstructions(); } break; } } // Show game instructions after story function showGameInstructions() { storyText.setText(''); // Instructions var instructions = ['SWIPE LEFT/RIGHT - Change lanes', 'SWIPE UP - Jump over obstacles', 'SWIPE DOWN - Slide under barriers', '', 'Collect coins and avoid obstacles!', 'Jump high enough to clear trains!']; for (var i = 0; i < instructions.length; i++) { var instructionText = new Text2(instructions[i], { size: 60, fill: 0xFFFFFF }); instructionText.anchor.set(0.5, 0.5); instructionText.x = 1024; instructionText.y = 900 + i * 80; introScreen.addChild(instructionText); } // Start button var buttonBg = LK.getAsset('barrier', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 0.8, tint: 0x00AA00 }); buttonBg.x = 1024; buttonBg.y = 1800; var buttonText = new Text2('TAP TO START', { size: 80, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); buttonText.x = 1024; buttonText.y = 1800; startButton = new Container(); startButton.addChild(buttonBg); startButton.addChild(buttonText); startButton.x = 0; startButton.y = 0; // Add button interaction startButton.down = function (x, y, obj) { startGame(); }; introScreen.addChild(startButton); } // Update story sequence introScreen.update = function () { if (storyStep < 4) { updateStory(); } }; game.addChild(introScreen); } // Start the actual game function startGame() { gameState = 'playing'; if (introScreen) { introScreen.destroy(); } // Start background music LK.playMusic('bgmusic'); } // Show intro screen at start createIntroScreen();
===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,9 @@
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
+var facekit = LK.import("@upit/facekit.v1");
/****
* Classes
****/
@@ -501,61 +502,191 @@
anchorY: 0.5,
scaleX: 6,
scaleY: 15,
tint: 0x000000,
- alpha: 0.8
+ alpha: 0.9
});
overlay.x = 1024;
overlay.y = 1366;
introScreen.addChild(overlay);
- // Title
- introTitle = new Text2('ENDLESS RUNNER', {
- size: 120,
- fill: 0xFFD700
- });
- introTitle.anchor.set(0.5, 0.5);
- introTitle.x = 1024;
- introTitle.y = 800;
- introScreen.addChild(introTitle);
- // Instructions
- var instructions = ['SWIPE LEFT/RIGHT - Change lanes', 'SWIPE UP - Jump over obstacles', 'SWIPE DOWN - Slide under barriers', '', 'Collect coins and avoid obstacles!', 'Jump high enough to clear trains!'];
- for (var i = 0; i < instructions.length; i++) {
- var instructionText = new Text2(instructions[i], {
- size: 60,
- fill: 0xFFFFFF
- });
- instructionText.anchor.set(0.5, 0.5);
- instructionText.x = 1024;
- instructionText.y = 1100 + i * 80;
- introScreen.addChild(instructionText);
- }
- // Start button
- var buttonBg = LK.getAsset('barrier', {
+ // Initialize camera for video background
+ facekit.initCamera();
+ // Story sequence variables
+ var storyStep = 0;
+ var storyTimer = 0;
+ var storyElements = [];
+ // Create story elements
+ var criminal = LK.getAsset('criminal', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
- scaleY: 0.8,
- tint: 0x00AA00
+ scaleY: 1.5
});
- buttonBg.x = 1024;
- buttonBg.y = 1800;
- var buttonText = new Text2('TAP TO START', {
+ criminal.x = 1024;
+ criminal.y = 1000;
+ criminal.alpha = 0;
+ var jewel = LK.getAsset('jewel', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 2,
+ scaleY: 2
+ });
+ jewel.x = 1024;
+ jewel.y = 800;
+ jewel.alpha = 0;
+ var police = LK.getAsset('police', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 1.2,
+ scaleY: 1.2
+ });
+ police.x = 1024;
+ police.y = 1200;
+ police.alpha = 0;
+ storyElements.push(criminal, jewel, police);
+ introScreen.addChild(criminal);
+ introScreen.addChild(jewel);
+ introScreen.addChild(police);
+ // Story text
+ var storyText = new Text2('', {
size: 80,
fill: 0xFFFFFF
});
- buttonText.anchor.set(0.5, 0.5);
- buttonText.x = 1024;
- buttonText.y = 1800;
- startButton = new Container();
- startButton.addChild(buttonBg);
- startButton.addChild(buttonText);
- startButton.x = 0;
- startButton.y = 0;
- // Add button interaction
- startButton.down = function (x, y, obj) {
- startGame();
+ storyText.anchor.set(0.5, 0.5);
+ storyText.x = 1024;
+ storyText.y = 1600;
+ introScreen.addChild(storyText);
+ // Story update function
+ function updateStory() {
+ storyTimer++;
+ switch (storyStep) {
+ case 0:
+ // Show criminal
+ if (storyTimer === 1) {
+ storyText.setText('Our hero committed a crime...');
+ tween(criminal, {
+ alpha: 1
+ }, {
+ duration: 1000
+ });
+ }
+ if (storyTimer === 120) {
+ storyStep++;
+ storyTimer = 0;
+ }
+ break;
+ case 1:
+ // Show jewels
+ if (storyTimer === 1) {
+ storyText.setText('But he needs precious jewels to escape!');
+ tween(jewel, {
+ alpha: 1
+ }, {
+ duration: 1000
+ });
+ tween(jewel, {
+ rotation: Math.PI * 2
+ }, {
+ duration: 2000,
+ loop: true
+ });
+ }
+ if (storyTimer === 120) {
+ storyStep++;
+ storyTimer = 0;
+ }
+ break;
+ case 2:
+ // Show police
+ if (storyTimer === 1) {
+ storyText.setText('The police are chasing him!');
+ tween(police, {
+ alpha: 1
+ }, {
+ duration: 1000
+ });
+ }
+ if (storyTimer === 120) {
+ storyStep++;
+ storyTimer = 0;
+ }
+ break;
+ case 3:
+ // Final message
+ if (storyTimer === 1) {
+ storyText.setText('Help him escape and collect jewels!');
+ // Hide story elements
+ tween(criminal, {
+ alpha: 0
+ }, {
+ duration: 1000
+ });
+ tween(jewel, {
+ alpha: 0
+ }, {
+ duration: 1000
+ });
+ tween(police, {
+ alpha: 0
+ }, {
+ duration: 1000
+ });
+ }
+ if (storyTimer === 90) {
+ showGameInstructions();
+ }
+ break;
+ }
+ }
+ // Show game instructions after story
+ function showGameInstructions() {
+ storyText.setText('');
+ // Instructions
+ var instructions = ['SWIPE LEFT/RIGHT - Change lanes', 'SWIPE UP - Jump over obstacles', 'SWIPE DOWN - Slide under barriers', '', 'Collect coins and avoid obstacles!', 'Jump high enough to clear trains!'];
+ for (var i = 0; i < instructions.length; i++) {
+ var instructionText = new Text2(instructions[i], {
+ size: 60,
+ fill: 0xFFFFFF
+ });
+ instructionText.anchor.set(0.5, 0.5);
+ instructionText.x = 1024;
+ instructionText.y = 900 + i * 80;
+ introScreen.addChild(instructionText);
+ }
+ // Start button
+ var buttonBg = LK.getAsset('barrier', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 1.5,
+ scaleY: 0.8,
+ tint: 0x00AA00
+ });
+ buttonBg.x = 1024;
+ buttonBg.y = 1800;
+ var buttonText = new Text2('TAP TO START', {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ buttonText.anchor.set(0.5, 0.5);
+ buttonText.x = 1024;
+ buttonText.y = 1800;
+ startButton = new Container();
+ startButton.addChild(buttonBg);
+ startButton.addChild(buttonText);
+ startButton.x = 0;
+ startButton.y = 0;
+ // Add button interaction
+ startButton.down = function (x, y, obj) {
+ startGame();
+ };
+ introScreen.addChild(startButton);
+ }
+ // Update story sequence
+ introScreen.update = function () {
+ if (storyStep < 4) {
+ updateStory();
+ }
};
- introScreen.addChild(startButton);
game.addChild(introScreen);
}
// Start the actual game
function startGame() {
karizmatik ama aynı zamanda sevimli görünen koşucu subway surfers karakteri. In-Game asset. 2d. High contrast. No shadows
bariyer. In-Game asset. 2d. High contrast. No shadows
vagon. In-Game asset. 2d. High contrast. No shadows
zümrüt. In-Game asset. 2d. High contrast. No shadows
çakıl taşları. In-Game asset. 2d. High contrast. No shadows