/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ // Egg class: the player character var Egg = Container.expand(function () { var self = Container.call(this); var eggAsset = self.attachAsset('egg', { anchorX: 0.5, anchorY: 0.5 }); self.width = eggAsset.width; self.height = eggAsset.height; self.vy = 0; self.gravity = 2.2 * 1.4; self.jumpStrength = -38 * 1.4; self.isAlive = true; self.jump = function () { if (!self.isAlive) { return; } self.vy = self.jumpStrength; }; self.update = function () { if (!self.isAlive) { return; } // Prevent movement for 3 seconds at game start if (typeof eggStartFreeze !== "undefined" && eggStartFreeze) { self.vy = 0; return; } self.vy += self.gravity; self.y += self.vy; // Clamp to screen if (self.y < self.height / 2) { self.y = self.height / 2; self.vy = 0; } if (self.y > 2732 - self.height / 2) { self.y = 2732 - self.height / 2; self.vy = 0; if (self.isAlive) { self.die(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } }; self.die = function () { self.isAlive = false; }; return self; }); // Obstacle class: obstacles coming from the right, with 36 unique colors, speeds, and rows var Obstacle = Container.expand(function () { var self = Container.call(this); // 6 possible rows (Y positions) var rowYs = [400, 800, 1200, 1600, 2000, 2400]; // Speed ranges for each row (same as before, mapped to row index) var rowSpeeds = [{ speedMin: 16, speedMax: 22 }, // row 0 { speedMin: 12, speedMax: 18 }, // row 1 { speedMin: 8, speedMax: 14 }, // row 2 { speedMin: 14, speedMax: 20 }, // row 3 { speedMin: 10, speedMax: 16 }, // row 4 { speedMin: 18, speedMax: 24 } // row 5 ]; // Pick a random row for each obstacle var rowIdx = Math.floor(Math.random() * rowYs.length); var rowY = rowYs[rowIdx]; var speedRange = rowSpeeds[rowIdx]; // Attach wall image asset for realistic wall appearance var obsAsset = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); // Randomly choose obstacle length: 1x, 2x, 3x, or 4x var possibleLengths = [1, 2, 3, 4]; var lengthMultiplier = possibleLengths[Math.floor(Math.random() * possibleLengths.length)]; self.width = obsAsset.width * lengthMultiplier; self.height = obsAsset.height; // Speed based on row, increased by 5% per level, and increased by 20% overall var currentLevel = typeof level !== "undefined" ? level : 1; var baseSpeed = speedRange.speedMin + Math.random() * (speedRange.speedMax - speedRange.speedMin); self.speed = baseSpeed * 1.2 * 1.4 * Math.pow(1.05, currentLevel - 1); self.x = 2048 + self.width / 2; // Y position based on row, with a little random offset for variety self.y = rowY + (Math.random() - 0.5) * 80; self.update = function () { self.x -= self.speed; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb // Sky blue }); /**** * Game Code ****/ // Add two background_view images for seamless horizontal scrolling // --- Game Code --- // Play new_composition__4.mp3 as background music (moved to user interaction) // Import storage plugin so 'storage' is defined and available var bgAsset1 = LK.getAsset('background_view', { anchorX: 0, anchorY: 0 }); bgAsset1.width = 2048; bgAsset1.height = 2732; bgAsset1.x = 0; bgAsset1.y = 0; game.addChild(bgAsset1); var bgAsset2 = LK.getAsset('background_view', { anchorX: 0, anchorY: 0 }); bgAsset2.width = 2048; bgAsset2.height = 2732; bgAsset2.x = bgAsset1.width; bgAsset2.y = 0; game.addChild(bgAsset2); // Background scroll speed (matches obstacle speed scale for effect) var bgScrollSpeed = 8; // Create the egg and add to game var egg = new Egg(); egg.x = 400; egg.y = 2732 / 2; game.addChild(egg); // --- Egg start freeze logic --- var eggStartFreeze = true; var originalEggGravity = egg.gravity; egg.gravity = 0; egg.vy = 0; // Allow egg to fall after 3 seconds if not already released by user var eggFreezeTimeout = LK.setTimeout(function () { if (eggStartFreeze) { eggStartFreeze = false; egg.gravity = originalEggGravity; } }, 3000); // Obstacles array var obstacles = []; var obstacleTimer = 0; var obstacleInterval = Math.floor(90 / 1.4); // frames between obstacles, 40% faster // Score var score = 0; var level = 1; var scoreTxt = new Text2('0', { size: 120, fill: "#fff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var levelTxt = new Text2('Seviye: 1', { size: 80, fill: "#fff" }); levelTxt.anchor.set(0.5, 0); levelTxt.y = scoreTxt.height * 0.8; LK.gui.top.addChild(levelTxt); // Touch/mouse jump handler game.down = function (x, y, obj) { if (!egg.isAlive) { return; } if (typeof eggStartFreeze !== "undefined" && eggStartFreeze) { // Release egg from freeze immediately eggStartFreeze = false; egg.gravity = originalEggGravity; LK.clearTimeout(eggFreezeTimeout); // Play music on first user interaction if (!game.musicStarted && !game.musicDisabled) { LK.playMusic('new_composition__4'); game.musicStarted = true; } return; } // Play music on first user interaction if not already playing if (!game.musicStarted && !game.musicDisabled) { LK.playMusic('new_composition__4'); game.musicStarted = true; } egg.jump(); LK.getSound('egg_jump').play(); }; // Main update loop game.update = function () { if (!egg.isAlive) { return; } // Background does not scroll bgAsset1.x = 0; bgAsset2.x = 2048; // Spawn obstacles obstacleTimer++; if (obstacleTimer >= obstacleInterval) { // Spawn a single obstacle (random row, random length) var obs = new Obstacle(); obstacles.push(obs); game.addChild(obs); obstacleTimer = 0; // Determine row index for this obstacle (to adjust spawn interval) var rowIdx = 0; if (typeof obs !== "undefined" && typeof obs.y !== "undefined") { // Reconstruct row index from y position (since Obstacle uses rowYs) var rowYs = [400, 800, 1200, 1600, 2000, 2400]; var minDist = Math.abs(obs.y - rowYs[0]); rowIdx = 0; for (var ri = 1; ri < rowYs.length; ri++) { var dist = Math.abs(obs.y - rowYs[ri]); if (dist < minDist) { minDist = dist; rowIdx = ri; } } } // 10% more frequent per row (row 0: 1.0, row 1: 0.9, row 2: 0.8, ...) var rowFrequencyMultiplier = 1 - rowIdx * 0.1; if (rowFrequencyMultiplier < 0.1) { rowFrequencyMultiplier = 0.1; } // Clamp to avoid zero/negative // Randomize next interval a bit, 25% more frequent, then apply row multiplier var baseInterval = Math.floor((70 + Math.floor(Math.random() * 40)) * 0.75); obstacleInterval = Math.floor(baseInterval * rowFrequencyMultiplier); } // Update obstacles and check for collisions var _loop = function _loop() { obs = obstacles[i]; // Remove if off screen if (obs.x < -obs.width) { obs.destroy(); obstacles.splice(i, 1); return 0; // continue } // Collision detection if (egg.intersects(obs)) { if (egg.isAlive) { egg.die(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } return 0; // stop further processing for this obstacle } // Score: passed obstacle if (obs.lastX === undefined) { obs.lastX = obs.x; } if (obs.lastX >= egg.x && obs.x < egg.x) { // Each obstacle gives 1 * (2^(level-1)) points points = Math.pow(2, level - 1); score += points; scoreTxt.setText(score); // Level up every 10 obstacles (counted by total obstacles passed, not points) newLevel = 1 + Math.floor(score / Math.pow(2, level - 1) / 10); if (newLevel > level) { level = newLevel; levelTxt.setText('Seviye: ' + level); } } obs.lastX = obs.x; }, obs, points, newLevel, _ret; for (var i = obstacles.length - 1; i >= 0; i--) { _ret = _loop(); if (_ret === 0) { continue; } if (_ret) { return _ret.v; } } }; // --- High Score Table Logic (global scope) --- var inputBox, highScoreTxt, inputLabel, inputBg, inputConfirmBtn, inputName; var highScores = []; var storageKey = "egg_highscores"; // Show high score table and input box at game over LK.on('gameover', function () { // Stop music and prevent it from restarting LK.stopMusic(); game.musicDisabled = true; LK.getSound('gameover').play(); // Load high scores from storage var loaded = storage.get(storageKey); if (loaded && Array.isArray(loaded)) { highScores = loaded; } else { highScores = []; } // Remove previous UI if exists if (inputBox) { inputBox.destroy(); } if (highScoreTxt) { highScoreTxt.destroy(); } if (inputLabel) { inputLabel.destroy(); } if (inputBg) { inputBg.destroy(); } if (inputConfirmBtn) { inputConfirmBtn.destroy(); } // Show high score table highScoreTxt = new Text2("Skor Tablosu\n" + highScores.map(function (s, i) { return i + 1 + ". " + s.name + ": " + s.score; }).join("\n"), { size: 90, fill: "#fff" }); highScoreTxt.anchor.set(0.5, 0); highScoreTxt.x = 2048 / 2; highScoreTxt.y = 600; game.addChild(highScoreTxt); // Show input for new high score if eligible var isHighScore = highScores.length < 5 || score > (highScores[highScores.length - 1] ? highScores[highScores.length - 1].score : 0); if (isHighScore && score > 0) { // Input background inputBg = LK.getAsset('obstacle', { anchorX: 0.5, anchorY: 0.5, color: 0x000000 }); inputBg.width = 800; inputBg.height = 300; inputBg.alpha = 0.7; inputBg.x = 2048 / 2; inputBg.y = 1500; game.addChild(inputBg); // Label inputLabel = new Text2("İsmini Gir:", { size: 80, fill: "#fff" }); inputLabel.anchor.set(0.5, 0.5); inputLabel.x = 2048 / 2; inputLabel.y = 1450; game.addChild(inputLabel); // Input box (Text2 as fake input) inputName = ""; inputBox = new Text2("_", { size: 100, fill: "#fff" }); inputBox.anchor.set(0.5, 0.5); inputBox.x = 2048 / 2; inputBox.y = 1550; game.addChild(inputBox); // Confirm button inputConfirmBtn = new Text2("Kaydet", { size: 80, fill: "#fff" }); inputConfirmBtn.anchor.set(0.5, 0.5); inputConfirmBtn.x = 2048 / 2; inputConfirmBtn.y = 1650; game.addChild(inputConfirmBtn); // Simulate input: tap to add a letter (A-Z), tap confirm to save inputBox.interactive = true; inputBox.down = function (x, y, obj) { // Cycle through A-Z var nextChar = "A"; if (inputName.length > 0) { var last = inputName.charCodeAt(inputName.length - 1); nextChar = String.fromCharCode(last >= 90 ? 65 : last + 1); } if (inputName.length < 8) { inputName += nextChar; inputBox.setText(inputName + "_"); } }; inputConfirmBtn.interactive = true; inputConfirmBtn.down = function (x, y, obj) { if (inputName.length === 0) { return; } // Save high score highScores.push({ name: inputName, score: score }); highScores.sort(function (a, b) { return b.score - a.score; }); if (highScores.length > 5) { highScores.length = 5; } storage.set(storageKey, highScores); // Refresh table if (highScoreTxt) { highScoreTxt.setText("Skor Tablosu\n" + highScores.map(function (s, i) { return i + 1 + ". " + s.name + ": " + s.score; }).join("\n")); } // Remove input UI if (inputBox) { inputBox.destroy(); } if (inputLabel) { inputLabel.destroy(); } if (inputBg) { inputBg.destroy(); } if (inputConfirmBtn) { inputConfirmBtn.destroy(); } }; } });
/****
* Plugins
****/
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
// Egg class: the player character
var Egg = Container.expand(function () {
var self = Container.call(this);
var eggAsset = self.attachAsset('egg', {
anchorX: 0.5,
anchorY: 0.5
});
self.width = eggAsset.width;
self.height = eggAsset.height;
self.vy = 0;
self.gravity = 2.2 * 1.4;
self.jumpStrength = -38 * 1.4;
self.isAlive = true;
self.jump = function () {
if (!self.isAlive) {
return;
}
self.vy = self.jumpStrength;
};
self.update = function () {
if (!self.isAlive) {
return;
}
// Prevent movement for 3 seconds at game start
if (typeof eggStartFreeze !== "undefined" && eggStartFreeze) {
self.vy = 0;
return;
}
self.vy += self.gravity;
self.y += self.vy;
// Clamp to screen
if (self.y < self.height / 2) {
self.y = self.height / 2;
self.vy = 0;
}
if (self.y > 2732 - self.height / 2) {
self.y = 2732 - self.height / 2;
self.vy = 0;
if (self.isAlive) {
self.die();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
}
};
self.die = function () {
self.isAlive = false;
};
return self;
});
// Obstacle class: obstacles coming from the right, with 36 unique colors, speeds, and rows
var Obstacle = Container.expand(function () {
var self = Container.call(this);
// 6 possible rows (Y positions)
var rowYs = [400, 800, 1200, 1600, 2000, 2400];
// Speed ranges for each row (same as before, mapped to row index)
var rowSpeeds = [{
speedMin: 16,
speedMax: 22
},
// row 0
{
speedMin: 12,
speedMax: 18
},
// row 1
{
speedMin: 8,
speedMax: 14
},
// row 2
{
speedMin: 14,
speedMax: 20
},
// row 3
{
speedMin: 10,
speedMax: 16
},
// row 4
{
speedMin: 18,
speedMax: 24
} // row 5
];
// Pick a random row for each obstacle
var rowIdx = Math.floor(Math.random() * rowYs.length);
var rowY = rowYs[rowIdx];
var speedRange = rowSpeeds[rowIdx];
// Attach wall image asset for realistic wall appearance
var obsAsset = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
// Randomly choose obstacle length: 1x, 2x, 3x, or 4x
var possibleLengths = [1, 2, 3, 4];
var lengthMultiplier = possibleLengths[Math.floor(Math.random() * possibleLengths.length)];
self.width = obsAsset.width * lengthMultiplier;
self.height = obsAsset.height;
// Speed based on row, increased by 5% per level, and increased by 20% overall
var currentLevel = typeof level !== "undefined" ? level : 1;
var baseSpeed = speedRange.speedMin + Math.random() * (speedRange.speedMax - speedRange.speedMin);
self.speed = baseSpeed * 1.2 * 1.4 * Math.pow(1.05, currentLevel - 1);
self.x = 2048 + self.width / 2;
// Y position based on row, with a little random offset for variety
self.y = rowY + (Math.random() - 0.5) * 80;
self.update = function () {
self.x -= self.speed;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87ceeb // Sky blue
});
/****
* Game Code
****/
// Add two background_view images for seamless horizontal scrolling
// --- Game Code ---
// Play new_composition__4.mp3 as background music (moved to user interaction)
// Import storage plugin so 'storage' is defined and available
var bgAsset1 = LK.getAsset('background_view', {
anchorX: 0,
anchorY: 0
});
bgAsset1.width = 2048;
bgAsset1.height = 2732;
bgAsset1.x = 0;
bgAsset1.y = 0;
game.addChild(bgAsset1);
var bgAsset2 = LK.getAsset('background_view', {
anchorX: 0,
anchorY: 0
});
bgAsset2.width = 2048;
bgAsset2.height = 2732;
bgAsset2.x = bgAsset1.width;
bgAsset2.y = 0;
game.addChild(bgAsset2);
// Background scroll speed (matches obstacle speed scale for effect)
var bgScrollSpeed = 8;
// Create the egg and add to game
var egg = new Egg();
egg.x = 400;
egg.y = 2732 / 2;
game.addChild(egg);
// --- Egg start freeze logic ---
var eggStartFreeze = true;
var originalEggGravity = egg.gravity;
egg.gravity = 0;
egg.vy = 0;
// Allow egg to fall after 3 seconds if not already released by user
var eggFreezeTimeout = LK.setTimeout(function () {
if (eggStartFreeze) {
eggStartFreeze = false;
egg.gravity = originalEggGravity;
}
}, 3000);
// Obstacles array
var obstacles = [];
var obstacleTimer = 0;
var obstacleInterval = Math.floor(90 / 1.4); // frames between obstacles, 40% faster
// Score
var score = 0;
var level = 1;
var scoreTxt = new Text2('0', {
size: 120,
fill: "#fff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var levelTxt = new Text2('Seviye: 1', {
size: 80,
fill: "#fff"
});
levelTxt.anchor.set(0.5, 0);
levelTxt.y = scoreTxt.height * 0.8;
LK.gui.top.addChild(levelTxt);
// Touch/mouse jump handler
game.down = function (x, y, obj) {
if (!egg.isAlive) {
return;
}
if (typeof eggStartFreeze !== "undefined" && eggStartFreeze) {
// Release egg from freeze immediately
eggStartFreeze = false;
egg.gravity = originalEggGravity;
LK.clearTimeout(eggFreezeTimeout);
// Play music on first user interaction
if (!game.musicStarted && !game.musicDisabled) {
LK.playMusic('new_composition__4');
game.musicStarted = true;
}
return;
}
// Play music on first user interaction if not already playing
if (!game.musicStarted && !game.musicDisabled) {
LK.playMusic('new_composition__4');
game.musicStarted = true;
}
egg.jump();
LK.getSound('egg_jump').play();
};
// Main update loop
game.update = function () {
if (!egg.isAlive) {
return;
}
// Background does not scroll
bgAsset1.x = 0;
bgAsset2.x = 2048;
// Spawn obstacles
obstacleTimer++;
if (obstacleTimer >= obstacleInterval) {
// Spawn a single obstacle (random row, random length)
var obs = new Obstacle();
obstacles.push(obs);
game.addChild(obs);
obstacleTimer = 0;
// Determine row index for this obstacle (to adjust spawn interval)
var rowIdx = 0;
if (typeof obs !== "undefined" && typeof obs.y !== "undefined") {
// Reconstruct row index from y position (since Obstacle uses rowYs)
var rowYs = [400, 800, 1200, 1600, 2000, 2400];
var minDist = Math.abs(obs.y - rowYs[0]);
rowIdx = 0;
for (var ri = 1; ri < rowYs.length; ri++) {
var dist = Math.abs(obs.y - rowYs[ri]);
if (dist < minDist) {
minDist = dist;
rowIdx = ri;
}
}
}
// 10% more frequent per row (row 0: 1.0, row 1: 0.9, row 2: 0.8, ...)
var rowFrequencyMultiplier = 1 - rowIdx * 0.1;
if (rowFrequencyMultiplier < 0.1) {
rowFrequencyMultiplier = 0.1;
} // Clamp to avoid zero/negative
// Randomize next interval a bit, 25% more frequent, then apply row multiplier
var baseInterval = Math.floor((70 + Math.floor(Math.random() * 40)) * 0.75);
obstacleInterval = Math.floor(baseInterval * rowFrequencyMultiplier);
}
// Update obstacles and check for collisions
var _loop = function _loop() {
obs = obstacles[i]; // Remove if off screen
if (obs.x < -obs.width) {
obs.destroy();
obstacles.splice(i, 1);
return 0; // continue
}
// Collision detection
if (egg.intersects(obs)) {
if (egg.isAlive) {
egg.die();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
return 0; // stop further processing for this obstacle
}
// Score: passed obstacle
if (obs.lastX === undefined) {
obs.lastX = obs.x;
}
if (obs.lastX >= egg.x && obs.x < egg.x) {
// Each obstacle gives 1 * (2^(level-1)) points
points = Math.pow(2, level - 1);
score += points;
scoreTxt.setText(score);
// Level up every 10 obstacles (counted by total obstacles passed, not points)
newLevel = 1 + Math.floor(score / Math.pow(2, level - 1) / 10);
if (newLevel > level) {
level = newLevel;
levelTxt.setText('Seviye: ' + level);
}
}
obs.lastX = obs.x;
},
obs,
points,
newLevel,
_ret;
for (var i = obstacles.length - 1; i >= 0; i--) {
_ret = _loop();
if (_ret === 0) {
continue;
}
if (_ret) {
return _ret.v;
}
}
};
// --- High Score Table Logic (global scope) ---
var inputBox, highScoreTxt, inputLabel, inputBg, inputConfirmBtn, inputName;
var highScores = [];
var storageKey = "egg_highscores";
// Show high score table and input box at game over
LK.on('gameover', function () {
// Stop music and prevent it from restarting
LK.stopMusic();
game.musicDisabled = true;
LK.getSound('gameover').play();
// Load high scores from storage
var loaded = storage.get(storageKey);
if (loaded && Array.isArray(loaded)) {
highScores = loaded;
} else {
highScores = [];
}
// Remove previous UI if exists
if (inputBox) {
inputBox.destroy();
}
if (highScoreTxt) {
highScoreTxt.destroy();
}
if (inputLabel) {
inputLabel.destroy();
}
if (inputBg) {
inputBg.destroy();
}
if (inputConfirmBtn) {
inputConfirmBtn.destroy();
}
// Show high score table
highScoreTxt = new Text2("Skor Tablosu\n" + highScores.map(function (s, i) {
return i + 1 + ". " + s.name + ": " + s.score;
}).join("\n"), {
size: 90,
fill: "#fff"
});
highScoreTxt.anchor.set(0.5, 0);
highScoreTxt.x = 2048 / 2;
highScoreTxt.y = 600;
game.addChild(highScoreTxt);
// Show input for new high score if eligible
var isHighScore = highScores.length < 5 || score > (highScores[highScores.length - 1] ? highScores[highScores.length - 1].score : 0);
if (isHighScore && score > 0) {
// Input background
inputBg = LK.getAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5,
color: 0x000000
});
inputBg.width = 800;
inputBg.height = 300;
inputBg.alpha = 0.7;
inputBg.x = 2048 / 2;
inputBg.y = 1500;
game.addChild(inputBg);
// Label
inputLabel = new Text2("İsmini Gir:", {
size: 80,
fill: "#fff"
});
inputLabel.anchor.set(0.5, 0.5);
inputLabel.x = 2048 / 2;
inputLabel.y = 1450;
game.addChild(inputLabel);
// Input box (Text2 as fake input)
inputName = "";
inputBox = new Text2("_", {
size: 100,
fill: "#fff"
});
inputBox.anchor.set(0.5, 0.5);
inputBox.x = 2048 / 2;
inputBox.y = 1550;
game.addChild(inputBox);
// Confirm button
inputConfirmBtn = new Text2("Kaydet", {
size: 80,
fill: "#fff"
});
inputConfirmBtn.anchor.set(0.5, 0.5);
inputConfirmBtn.x = 2048 / 2;
inputConfirmBtn.y = 1650;
game.addChild(inputConfirmBtn);
// Simulate input: tap to add a letter (A-Z), tap confirm to save
inputBox.interactive = true;
inputBox.down = function (x, y, obj) {
// Cycle through A-Z
var nextChar = "A";
if (inputName.length > 0) {
var last = inputName.charCodeAt(inputName.length - 1);
nextChar = String.fromCharCode(last >= 90 ? 65 : last + 1);
}
if (inputName.length < 8) {
inputName += nextChar;
inputBox.setText(inputName + "_");
}
};
inputConfirmBtn.interactive = true;
inputConfirmBtn.down = function (x, y, obj) {
if (inputName.length === 0) {
return;
}
// Save high score
highScores.push({
name: inputName,
score: score
});
highScores.sort(function (a, b) {
return b.score - a.score;
});
if (highScores.length > 5) {
highScores.length = 5;
}
storage.set(storageKey, highScores);
// Refresh table
if (highScoreTxt) {
highScoreTxt.setText("Skor Tablosu\n" + highScores.map(function (s, i) {
return i + 1 + ". " + s.name + ": " + s.score;
}).join("\n"));
}
// Remove input UI
if (inputBox) {
inputBox.destroy();
}
if (inputLabel) {
inputLabel.destroy();
}
if (inputBg) {
inputBg.destroy();
}
if (inputConfirmBtn) {
inputConfirmBtn.destroy();
}
};
}
});