User prompt
Ajusta el apartado de códigos ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Haz las letras más grandes y separadas ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Haz que las letras y números estén simétricas y bonitas ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Hazlo más grande
User prompt
Haz las letras y números más grandes en el apartado de códigos
User prompt
Mejora el diseño del apartado de codigos ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
En el apartado de códigos añade números del 0 al 9
User prompt
Haz que las letras en el apartado de códigos sea más grandes para que se puedan pulsar más fácilmente
User prompt
Mejora el apartado de códigos, de forma que sea simétrico y bonito ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
En el menú principal pon un apartado que se llame códigos, en el que se pueda escribir, y si pones “ZKUIT1gamesstaffmode” se te active un modo administrador durante 15 minutos en el que puedas ir a un nivel determinado ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Haz que de fondo pasen nubes y demás ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: setTimeout is not a function. (In 'setTimeout(function () { __$(410); tween(game, { x: originalX }, { duration: 200, easing: tween.easeOut }); }, 600)', 'setTimeout' is undefined)' in or related to this line: 'setTimeout(function () {' Line Number: 776 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Mejora todo lo que puedas el juego ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Haz que el avión sea lo más realista posible
User prompt
ZK Haz que en el nivel 1 el progreso sea 5, en el nivel 2 sea 10, en el tres 15 y así sucesivamente
User prompt
Haz un menú principal, en el que ahí puedas darle a jugar y ver el leaderboard
User prompt
Please fix the bug: 'Error: Invalid value. Only literals or 1-level deep objects/arrays containing literals are allowed.' in or related to this line: 'storage.leaderboard = leaderboard;' Line Number: 490 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Haz un leadertop en el que salga un top del 1 al 100 con las personas a las que más nivel a llegado ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Haz que el nivel 1 sea más fácil
User prompt
Haz que cuando llegue al final de un nivel haya una línea de meta, y que cuando la cruce salga un menú que en el que puedas reintentar el nivel, ir al siguiente nivel, o volver al nivel 1
User prompt
Haz que cuando pierda, no tenga que volver al nivel 1, sino no que empiece en el nivel que he perdido ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'TypeError: undefined is not an object (evaluating 'tower.lastX')' in or related to this line: 'if (tower.lastX >= -200 && tower.x < -200) {' Line Number: 219
User prompt
Haz que el nivel 1 sea más fácil
User prompt
El avión vuelve a ir más rápido que la cámara
User prompt
Me gustaría que fuese un avión más realista y que vaya hacia delante y no de lado, también quiero que las torres sean más realistas
/**** * Classes ****/ var Aircraft = Container.expand(function () { var self = Container.call(this); // Main aircraft body var aircraftGraphics = self.attachAsset('aircraft', { anchorX: 0.5, anchorY: 0.5 }); // Aircraft wings var leftWing = self.attachAsset('aircraftWing', { anchorX: 0.5, anchorY: 0.5 }); leftWing.x = -10; leftWing.y = 8; leftWing.rotation = -0.2; var rightWing = self.attachAsset('aircraftWing', { anchorX: 0.5, anchorY: 0.5 }); rightWing.x = -10; rightWing.y = -8; rightWing.rotation = 0.2; // Aircraft tail var tail = self.attachAsset('aircraftTail', { anchorX: 0.5, anchorY: 0.5 }); tail.x = -45; tail.y = 0; self.speed = 3; self.lastY = 0; self.update = function () { // Keep aircraft moving forward self.x += self.speed; // Update last position for collision detection self.lastY = self.y; }; return self; }); var Tower = Container.expand(function () { var self = Container.call(this); // Tower base var towerBase = self.attachAsset('towerBase', { anchorX: 0.5, anchorY: 0.5 }); // Tower top var towerTop = self.attachAsset('towerTop', { anchorX: 0.5, anchorY: 0.5 }); towerTop.y = -420; // Position at top of tower // Add windows to make it look more realistic for (var w = 0; w < 3; w++) { var window1 = self.attachAsset('towerWindow', { anchorX: 0.5, anchorY: 0.5 }); window1.x = -30; window1.y = -300 + w * 150; var window2 = self.attachAsset('towerWindow', { anchorX: 0.5, anchorY: 0.5 }); window2.x = 30; window2.y = -300 + w * 150; } self.lastX = 0; self.passed = false; self.update = function () { // Move tower from right to left self.x -= 4; // Update last position self.lastX = self.x; }; return self; }); /**** * Initialize Game ****/ // Game variables var game = new LK.Game({ backgroundColor: 0x87CEFA // More realistic sky blue background }); /**** * Game Code ****/ // Game variables // Initialize assets for the tower dodge flight game var aircraft; var towers = []; var currentLevel = 1; var levelScore = 0; var towersToComplete = 10; // Towers to dodge to complete level var towerSpawnTimer = 0; var gameStarted = false; // UI Elements var levelText = new Text2('Level: 1', { size: 60, fill: 0xFFFFFF }); levelText.anchor.set(0, 0); LK.gui.topLeft.addChild(levelText); levelText.x = 120; // Avoid top-left menu area levelText.y = 20; var scoreText = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreText.anchor.set(1, 0); LK.gui.topRight.addChild(scoreText); var progressText = new Text2('Progress: 0/10', { size: 50, fill: 0xFFFFFF }); progressText.anchor.set(0.5, 0); LK.gui.top.addChild(progressText); progressText.y = 100; // Initialize aircraft aircraft = game.addChild(new Aircraft()); aircraft.x = 300; aircraft.y = 1366; // Center vertically aircraft.lastIntersecting = false; // Touch controls for aircraft movement var dragActive = false; game.down = function (x, y, obj) { dragActive = true; gameStarted = true; }; game.up = function (x, y, obj) { dragActive = false; }; game.move = function (x, y, obj) { if (dragActive) { aircraft.y = y; // Keep aircraft within screen bounds if (aircraft.y < 50) aircraft.y = 50; if (aircraft.y > 2680) aircraft.y = 2680; } }; // Function to spawn tower function spawnTower() { var tower = new Tower(); tower.x = 2200; // Start from right edge // Random height position with gap for aircraft to pass var gapSize = Math.max(300, 400 - currentLevel * 20); // Gap gets smaller each level var gapPosition = Math.random() * (2732 - gapSize - 200) + 100; // Create top tower var topTower = game.addChild(new Tower()); topTower.x = tower.x; topTower.y = gapPosition / 2; topTower.lastIntersecting = false; towers.push(topTower); // Create bottom tower var bottomTower = game.addChild(new Tower()); bottomTower.x = tower.x; bottomTower.y = gapPosition + gapSize + (2732 - gapPosition - gapSize) / 2; bottomTower.lastIntersecting = false; towers.push(bottomTower); } // Function to complete level function completeLevel() { currentLevel++; levelScore = 0; towersToComplete = Math.min(15, 10 + currentLevel); // Max 15 towers per level // Clear existing towers for (var i = towers.length - 1; i >= 0; i--) { towers[i].destroy(); towers.splice(i, 1); } // Reset aircraft position aircraft.x = 300; aircraft.y = 1366; // Update UI levelText.setText('Level: ' + currentLevel); progressText.setText('Progress: 0/' + towersToComplete); // Flash screen green for level completion LK.effects.flashScreen(0x00ff00, 1000); } // Function to handle game over function gameOver() { LK.effects.flashScreen(0xff0000, 1000); LK.getSound('crash').play(); LK.showGameOver(); } // Main game update loop game.update = function () { if (!gameStarted) return; // Spawn towers based on level difficulty var spawnRate = Math.max(60, 120 - currentLevel * 10); // Faster spawning each level if (LK.ticks % spawnRate === 0) { spawnTower(); } // Update towers for (var i = towers.length - 1; i >= 0; i--) { var tower = towers[i]; // Check if tower went off screen if (tower.lastX >= -200 && tower.x < -200) { tower.destroy(); towers.splice(i, 1); continue; } // Check collision with aircraft var currentIntersecting = aircraft.intersects(tower); if (!tower.lastIntersecting && currentIntersecting) { gameOver(); return; } tower.lastIntersecting = currentIntersecting; // Check if aircraft passed tower (score point) if (!tower.passed && tower.x < aircraft.x - 100) { tower.passed = true; levelScore++; LK.setScore(LK.getScore() + 10 * currentLevel); // More points per level LK.getSound('dodge').play(); // Update progress var progress = Math.floor(levelScore / 2); // Two towers per obstacle progressText.setText('Progress: ' + progress + '/' + towersToComplete); scoreText.setText('Score: ' + LK.getScore()); // Check level completion if (progress >= towersToComplete) { completeLevel(); } } } // Keep aircraft moving at realistic forward speed aircraft.speed = 4 + currentLevel * 0.3; // More consistent forward movement };
/****
* Classes
****/
var Aircraft = Container.expand(function () {
var self = Container.call(this);
// Main aircraft body
var aircraftGraphics = self.attachAsset('aircraft', {
anchorX: 0.5,
anchorY: 0.5
});
// Aircraft wings
var leftWing = self.attachAsset('aircraftWing', {
anchorX: 0.5,
anchorY: 0.5
});
leftWing.x = -10;
leftWing.y = 8;
leftWing.rotation = -0.2;
var rightWing = self.attachAsset('aircraftWing', {
anchorX: 0.5,
anchorY: 0.5
});
rightWing.x = -10;
rightWing.y = -8;
rightWing.rotation = 0.2;
// Aircraft tail
var tail = self.attachAsset('aircraftTail', {
anchorX: 0.5,
anchorY: 0.5
});
tail.x = -45;
tail.y = 0;
self.speed = 3;
self.lastY = 0;
self.update = function () {
// Keep aircraft moving forward
self.x += self.speed;
// Update last position for collision detection
self.lastY = self.y;
};
return self;
});
var Tower = Container.expand(function () {
var self = Container.call(this);
// Tower base
var towerBase = self.attachAsset('towerBase', {
anchorX: 0.5,
anchorY: 0.5
});
// Tower top
var towerTop = self.attachAsset('towerTop', {
anchorX: 0.5,
anchorY: 0.5
});
towerTop.y = -420; // Position at top of tower
// Add windows to make it look more realistic
for (var w = 0; w < 3; w++) {
var window1 = self.attachAsset('towerWindow', {
anchorX: 0.5,
anchorY: 0.5
});
window1.x = -30;
window1.y = -300 + w * 150;
var window2 = self.attachAsset('towerWindow', {
anchorX: 0.5,
anchorY: 0.5
});
window2.x = 30;
window2.y = -300 + w * 150;
}
self.lastX = 0;
self.passed = false;
self.update = function () {
// Move tower from right to left
self.x -= 4;
// Update last position
self.lastX = self.x;
};
return self;
});
/****
* Initialize Game
****/
// Game variables
var game = new LK.Game({
backgroundColor: 0x87CEFA // More realistic sky blue background
});
/****
* Game Code
****/
// Game variables
// Initialize assets for the tower dodge flight game
var aircraft;
var towers = [];
var currentLevel = 1;
var levelScore = 0;
var towersToComplete = 10; // Towers to dodge to complete level
var towerSpawnTimer = 0;
var gameStarted = false;
// UI Elements
var levelText = new Text2('Level: 1', {
size: 60,
fill: 0xFFFFFF
});
levelText.anchor.set(0, 0);
LK.gui.topLeft.addChild(levelText);
levelText.x = 120; // Avoid top-left menu area
levelText.y = 20;
var scoreText = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(1, 0);
LK.gui.topRight.addChild(scoreText);
var progressText = new Text2('Progress: 0/10', {
size: 50,
fill: 0xFFFFFF
});
progressText.anchor.set(0.5, 0);
LK.gui.top.addChild(progressText);
progressText.y = 100;
// Initialize aircraft
aircraft = game.addChild(new Aircraft());
aircraft.x = 300;
aircraft.y = 1366; // Center vertically
aircraft.lastIntersecting = false;
// Touch controls for aircraft movement
var dragActive = false;
game.down = function (x, y, obj) {
dragActive = true;
gameStarted = true;
};
game.up = function (x, y, obj) {
dragActive = false;
};
game.move = function (x, y, obj) {
if (dragActive) {
aircraft.y = y;
// Keep aircraft within screen bounds
if (aircraft.y < 50) aircraft.y = 50;
if (aircraft.y > 2680) aircraft.y = 2680;
}
};
// Function to spawn tower
function spawnTower() {
var tower = new Tower();
tower.x = 2200; // Start from right edge
// Random height position with gap for aircraft to pass
var gapSize = Math.max(300, 400 - currentLevel * 20); // Gap gets smaller each level
var gapPosition = Math.random() * (2732 - gapSize - 200) + 100;
// Create top tower
var topTower = game.addChild(new Tower());
topTower.x = tower.x;
topTower.y = gapPosition / 2;
topTower.lastIntersecting = false;
towers.push(topTower);
// Create bottom tower
var bottomTower = game.addChild(new Tower());
bottomTower.x = tower.x;
bottomTower.y = gapPosition + gapSize + (2732 - gapPosition - gapSize) / 2;
bottomTower.lastIntersecting = false;
towers.push(bottomTower);
}
// Function to complete level
function completeLevel() {
currentLevel++;
levelScore = 0;
towersToComplete = Math.min(15, 10 + currentLevel); // Max 15 towers per level
// Clear existing towers
for (var i = towers.length - 1; i >= 0; i--) {
towers[i].destroy();
towers.splice(i, 1);
}
// Reset aircraft position
aircraft.x = 300;
aircraft.y = 1366;
// Update UI
levelText.setText('Level: ' + currentLevel);
progressText.setText('Progress: 0/' + towersToComplete);
// Flash screen green for level completion
LK.effects.flashScreen(0x00ff00, 1000);
}
// Function to handle game over
function gameOver() {
LK.effects.flashScreen(0xff0000, 1000);
LK.getSound('crash').play();
LK.showGameOver();
}
// Main game update loop
game.update = function () {
if (!gameStarted) return;
// Spawn towers based on level difficulty
var spawnRate = Math.max(60, 120 - currentLevel * 10); // Faster spawning each level
if (LK.ticks % spawnRate === 0) {
spawnTower();
}
// Update towers
for (var i = towers.length - 1; i >= 0; i--) {
var tower = towers[i];
// Check if tower went off screen
if (tower.lastX >= -200 && tower.x < -200) {
tower.destroy();
towers.splice(i, 1);
continue;
}
// Check collision with aircraft
var currentIntersecting = aircraft.intersects(tower);
if (!tower.lastIntersecting && currentIntersecting) {
gameOver();
return;
}
tower.lastIntersecting = currentIntersecting;
// Check if aircraft passed tower (score point)
if (!tower.passed && tower.x < aircraft.x - 100) {
tower.passed = true;
levelScore++;
LK.setScore(LK.getScore() + 10 * currentLevel); // More points per level
LK.getSound('dodge').play();
// Update progress
var progress = Math.floor(levelScore / 2); // Two towers per obstacle
progressText.setText('Progress: ' + progress + '/' + towersToComplete);
scoreText.setText('Score: ' + LK.getScore());
// Check level completion
if (progress >= towersToComplete) {
completeLevel();
}
}
}
// Keep aircraft moving at realistic forward speed
aircraft.speed = 4 + currentLevel * 0.3; // More consistent forward movement
};