Code edit (1 edits merged)
Please save this source code
User prompt
No están tirando objetos a la moto, mejora la aparición de las personas y objetos al lado de la ruta. Deben aparecer antes y asegúrate que siguen escalando y alejándose del centro hasta salir por completo de la pantalla, pin un margen alto ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Cada 10 segundos debe repetirse aleatoriamente una de seis frases que serán assets de sonido
Code edit (2 edits merged)
Please save this source code
User prompt
Los objetos al lado del camino deben estar mucho más espaciados ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'play')' in or related to this line: 'LK.playMusic('moto').play();' Line Number: 51
Code edit (13 edits merged)
Please save this source code
User prompt
Debe salir del asset karina o de truck1 que es lo mismo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
El ítem debe salir desde el asset karina y debe caer el algún lugar random de la ruta siguiendo una parábola ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Los assets al lado de la ruta deben seguir escalando y alejarse del centro hasta salir por completo, ahora falla al final ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Cuando l al personas los árboles y los carteles digan de la pantalla, en ves de seguir escalando y alejarse del centro simplemente bajan y rompen la perspectiva ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
El juego debe tener una barra de power vertical a la derecha, cuando un proyectil lo golpea debe bajar un 3% de la barra, también habrá otro tipo de proyectil que le bajará un 50%, la camioneta debe ser una sola y debe estar siempre delante de la moto bastante alejada, la camioneta debe arrojar ítem que restauran un 3% el power ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Cuando la moto pasa de la mitad izquierda debe hacer un flip en el eje y para que de la sensacion de peespectiva ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Están tirando muchos proyectiles no debe haber más de 3 proyectiles al mismo tiempo
Code edit (1 edits merged)
Please save this source code
User prompt
Todos los personajes deben verse mucho más grandes
User prompt
El efecto de avance esta parcialmente resuelto continúa con eso, el juego no debe tener un game over aún
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Motorcycle = Container.expand(function () { var self = Container.call(this); var motorcycleGraphics = self.attachAsset('motorcycle', { anchorX: 0.5, anchorY: 0.5 }); self.health = 3; self.speed = 0; self.maxSpeed = 8; self.update = function () { if (gameStarted) { // Gradually increase speed if (self.speed < self.maxSpeed) { self.speed += 0.02; } // Move forward (simulate road movement) roadOffset += self.speed; } }; self.takeDamage = function () { self.health--; // Flash red when hit LK.effects.flashObject(self, 0xff0000, 500); LK.getSound('hit').play(); if (self.health <= 0) { LK.showGameOver(); } }; return self; }); var Projectile = Container.expand(function () { var self = Container.call(this); var projectileGraphics = self.attachAsset('projectile', { anchorX: 0.5, anchorY: 0.5 }); self.velocityX = 0; self.velocityY = 0; self.gravity = 0; self.update = function () { self.x += self.velocityX; self.y += self.velocityY; self.velocityY += self.gravity; // Rotate projectile based on velocity self.rotation += 0.1; }; return self; }); var RoadsideObject = Container.expand(function (type) { var self = Container.call(this); self.objectType = type || 'person'; var objectGraphics = self.attachAsset(self.objectType, { anchorX: 0.5, anchorY: 1.0 }); self.throwTimer = 0; self.throwDelay = Math.random() * 180 + 60; // Random delay between throws self.isLeftSide = true; self.originalY = 0; // Store original Y position for movement animation self.update = function () { // Only people throw objects if (self.objectType === 'person') { self.throwTimer++; if (self.throwTimer >= self.throwDelay && gameStarted) { self.throwObject(); self.throwTimer = 0; self.throwDelay = Math.random() * 120 + 400000000; // Next throw delay } } // Move object backward to simulate forward motion if (gameStarted && motorcycle.speed > 0) { self.y += motorcycle.speed * 3; // Calculate current perspective for this object var currentDistance = Math.max(0, roadY - self.y); var perspective = Math.max(0.01, Math.min(1, 1 - currentDistance / horizonDistance)); var roadWidth = 2048 * perspective; // Update object position and scale based on perspective if (self.isLeftSide) { self.x = 1024 - roadWidth / 2 - 120 * perspective; } else { self.x = 1024 + roadWidth / 2 + 120 * perspective; } self.scaleX = perspective; self.scaleY = perspective; // Reset object position when it goes past the bottom if (self.y > roadY + 200) { self.y = self.originalY; // Reset scale for new cycle var resetDistance = roadY - self.originalY; var resetPerspective = Math.max(0.01, Math.min(1, 1 - resetDistance / horizonDistance)); self.scaleX = resetPerspective; self.scaleY = resetPerspective; } } }; self.throwObject = function () { // Only throw if there are less than 3 projectiles if (projectiles.length >= 3) { return; // Don't throw if we already have 3 or more projectiles } var projectile = new Projectile(); projectile.x = self.x; projectile.y = self.y - 20; // Calculate trajectory toward motorcycle position on road var targetX = motorcycle.x + (Math.random() - 0.5) * 200; // Target motorcycle with some variance var targetY = roadY; projectile.velocityX = (targetX - projectile.x) * 0.015; projectile.velocityY = (targetY - projectile.y) * 0.015; projectile.gravity = 0.2; projectiles.push(projectile); game.addChild(projectile); LK.getSound('throw').play(); }; return self; }); var Truck = Container.expand(function () { var self = Container.call(this); var truckGraphics = self.attachAsset('truck', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -6; self.active = true; self.update = function () { if (self.active) { self.y += self.speed; // Move toward horizon (upward on screen) // Calculate perspective based on distance to horizon var distanceToHorizon = roadY - horizonY; // Total distance from bottom to horizon var currentDistance = roadY - self.y; // Current distance from bottom var perspective = Math.max(0, 1 - currentDistance / distanceToHorizon); // Perspective ratio // Move horizontally toward center point (1024) as truck approaches horizon var centerX = 1024; var horizontalConvergence = (centerX - self.x) * 0.02; // Gradual convergence self.x += horizontalConvergence; // Scale trucks according to perspective self.scaleX = perspective; self.scaleY = perspective; // Deactivate truck when it reaches horizon if (self.y <= horizonY) { self.active = false; self.visible = false; } } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb }); /**** * Game Code ****/ var roadY = 2732; // Position road at very bottom of screen var horizonY = 1366; // Horizon at middle height of screen (2732/2) var roadOffset = 0; var gameStarted = false; var trucksCleared = false; // Create perspective road using segments var roadSegments = []; var roadLines = []; var leftSidewalks = []; var rightSidewalks = []; // Create road segments that form triangular perspective from full width to horizon var totalSegments = 60; var horizonDistance = roadY - horizonY; // Distance from bottom to horizon for (var i = 0; i < totalSegments; i++) { var distance = i / totalSegments * horizonDistance; // Distance from bottom var yPosition = roadY - distance; var perspective = 1 - distance / horizonDistance; // Linear perspective to horizon var roadWidth = 2048 * perspective; // Road width from full screen width to narrow at horizon var segmentHeight = horizonDistance / totalSegments * 1.2; if (yPosition >= horizonY) { // Only render segments from bottom to horizon // Road segment var roadSeg = game.addChild(LK.getAsset('road_segment', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: yPosition, scaleX: roadWidth / 100, scaleY: segmentHeight / 50 })); roadSegments.push(roadSeg); // Center line segments if (i % 4 == 0) { // Every 4th segment for dashed line effect var centerLine = game.addChild(LK.getAsset('road_line', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: yPosition, scaleX: perspective * 2, scaleY: perspective * 2 })); roadLines.push(centerLine); } // Left sidewalk var leftSidewalk = game.addChild(LK.getAsset('sidewalk_segment', { anchorX: 1, anchorY: 0.5, x: 1024 - roadWidth / 2 - 80 * perspective, y: yPosition, scaleX: perspective * 1.5, scaleY: segmentHeight / 40 })); leftSidewalks.push(leftSidewalk); // Right sidewalk var rightSidewalk = game.addChild(LK.getAsset('sidewalk_segment', { anchorX: 0, anchorY: 0.5, x: 1024 + roadWidth / 2 + 80 * perspective, y: yPosition, scaleX: perspective * 1.5, scaleY: segmentHeight / 40 })); rightSidewalks.push(rightSidewalk); } } // Create trucks at bottom of screen blocking the path var trucks = []; var truck1 = game.addChild(new Truck()); truck1.x = 900; truck1.y = roadY; var truck2 = game.addChild(new Truck()); truck2.x = 1150; truck2.y = roadY; trucks.push(truck1, truck2); // Create motorcycle at bottom of screen behind trucks var motorcycle = game.addChild(new Motorcycle()); motorcycle.x = 1024; motorcycle.y = roadY - 50; // Positioned on road at bottom of screen // Create roadside objects (people, trees, signs) var roadsideObjects = []; var projectiles = []; var objectTypes = ['person', 'tree', 'sign']; // Left side objects positioned along the perspective sidewalk for (var i = 0; i < 30; i++) { var objectType = objectTypes[i % 3]; // Cycle through person, tree, sign var leftObject = game.addChild(new RoadsideObject(objectType)); var distance = i / 30 * horizonDistance; var yPos = roadY - distance; var perspective = 1 - distance / horizonDistance; var roadWidth = 2048 * perspective; if (yPos >= horizonY) { leftObject.x = 1024 - roadWidth / 2 - 120 * perspective; leftObject.y = yPos; leftObject.originalY = yPos; leftObject.scaleX = perspective; leftObject.scaleY = perspective; leftObject.isLeftSide = true; roadsideObjects.push(leftObject); } } // Right side objects positioned along the perspective sidewalk for (var i = 0; i < 30; i++) { var objectType = objectTypes[i % 3]; // Cycle through person, tree, sign var rightObject = game.addChild(new RoadsideObject(objectType)); var distance = i / 30 * horizonDistance; var yPos = roadY - distance; var perspective = 1 - distance / horizonDistance; var roadWidth = 2048 * perspective; if (yPos >= horizonY) { rightObject.x = 1024 + roadWidth / 2 + 120 * perspective; rightObject.y = yPos; rightObject.originalY = yPos; rightObject.scaleX = perspective; rightObject.scaleY = perspective; rightObject.isLeftSide = false; roadsideObjects.push(rightObject); } } // Score display var scoreTxt = new Text2('Distance: 0m', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Health display var healthTxt = new Text2('Health: 3', { size: 60, fill: 0xFF0000 }); healthTxt.anchor.set(0, 0); healthTxt.x = 50; healthTxt.y = 50; LK.gui.topRight.addChild(healthTxt); var dragStartX = 0; var isDragging = false; // Touch controls game.down = function (x, y, obj) { if (gameStarted) { isDragging = true; dragStartX = x; } }; game.move = function (x, y, obj) { if (isDragging && gameStarted) { var deltaX = x - dragStartX; var newX = motorcycle.x + deltaX * 0.5; // Keep motorcycle on perspective road at bottom (full width bounds) var roadLeft = 200; // Road width at motorcycle position (bottom of screen) var roadRight = 1848; // Almost full screen width if (newX >= roadLeft && newX <= roadRight) { motorcycle.x = newX; } dragStartX = x; } }; game.up = function (x, y, obj) { isDragging = false; }; game.update = function () { // Check if trucks have cleared if (!trucksCleared) { var allTrucksCleared = true; for (var i = 0; i < trucks.length; i++) { if (trucks[i].y > roadY - 300) { // Start immediately when trucks move forward significantly allTrucksCleared = false; break; } } if (allTrucksCleared) { trucksCleared = true; gameStarted = true; } } // Animate individual road blocks advancing from horizon if (gameStarted && motorcycle.speed > 0) { var roadMovement = motorcycle.speed * 3; // Move individual road segments from horizon toward bottom for (var i = 0; i < roadSegments.length; i++) { roadSegments[i].y += roadMovement; // Calculate current perspective for this segment var currentDistance = Math.max(0, roadY - roadSegments[i].y); var perspective = Math.max(0.01, Math.min(1, 1 - currentDistance / horizonDistance)); var roadWidth = 2048 * perspective; // Update segment scaling based on current position roadSegments[i].scaleX = roadWidth / 100; roadSegments[i].scaleY = horizonDistance / totalSegments * 1.2 / 50 * perspective; // Reset segments that have passed the bottom back to horizon with proper spacing if (roadSegments[i].y > roadY + 100) { var segmentSpacing = horizonDistance / totalSegments; roadSegments[i].y = horizonY + i * segmentSpacing / totalSegments; roadSegments[i].scaleX = 0.01; // Very small at horizon roadSegments[i].scaleY = 0.01; } } // Move individual road lines from horizon toward bottom for (var i = 0; i < roadLines.length; i++) { roadLines[i].y += roadMovement; // Calculate current perspective for this line var currentDistance = Math.max(0, roadY - roadLines[i].y); var perspective = Math.max(0.01, Math.min(1, 1 - currentDistance / horizonDistance)); // Update line scaling based on current position roadLines[i].scaleX = perspective * 3; roadLines[i].scaleY = perspective * 4; // Reset lines that have passed the bottom back to horizon with proper spacing if (roadLines[i].y > roadY + 100) { var lineSpacing = horizonDistance / totalSegments * 4; // Lines are spaced every 4 segments var lineIndex = roadLines.indexOf(roadLines[i]); roadLines[i].y = horizonY + lineIndex * lineSpacing / 15; // Distribute evenly roadLines[i].scaleX = 0.01; // Very small at horizon roadLines[i].scaleY = 0.01; } } // Move individual sidewalk blocks from horizon toward bottom for (var i = 0; i < leftSidewalks.length; i++) { leftSidewalks[i].y += roadMovement; rightSidewalks[i].y += roadMovement; // Calculate current perspective for sidewalks var currentDistance = Math.max(0, roadY - leftSidewalks[i].y); var perspective = Math.max(0.01, Math.min(1, 1 - currentDistance / horizonDistance)); var roadWidth = 2048 * perspective; var segmentHeight = horizonDistance / totalSegments * 1.2 * perspective; // Update sidewalk positions and scaling based on current position leftSidewalks[i].x = 1024 - roadWidth / 2 - 80 * perspective; leftSidewalks[i].scaleX = perspective * 2; leftSidewalks[i].scaleY = segmentHeight / 40; rightSidewalks[i].x = 1024 + roadWidth / 2 + 80 * perspective; rightSidewalks[i].scaleX = perspective * 2; rightSidewalks[i].scaleY = segmentHeight / 40; // Reset sidewalks that have passed the bottom back to horizon with proper spacing if (leftSidewalks[i].y > roadY + 100) { var sidewalkSpacing = horizonDistance / totalSegments; leftSidewalks[i].y = horizonY + i * sidewalkSpacing / totalSegments; rightSidewalks[i].y = horizonY + i * sidewalkSpacing / totalSegments; // Reset to horizon positions with minimal scale leftSidewalks[i].x = 1024 - 1; rightSidewalks[i].x = 1024 + 1; leftSidewalks[i].scaleX = 0.01; rightSidewalks[i].scaleX = 0.01; leftSidewalks[i].scaleY = 0.01; rightSidewalks[i].scaleY = 0.01; } } } // Update score if (gameStarted) { var distance = Math.floor(roadOffset / 10); scoreTxt.setText('Distance: ' + distance + 'm'); LK.setScore(distance); } // Update health display healthTxt.setText('Health: ' + motorcycle.health); // Check for motorcycle flip when crossing center line for perspective effect if (gameStarted) { if (motorcycle.lastX === undefined) { motorcycle.lastX = motorcycle.x; motorcycle.isFlipping = false; } // Check if motorcycle crossed from left half to right half or vice versa var screenCenter = 1024; var crossedToRight = motorcycle.lastX < screenCenter && motorcycle.x >= screenCenter; var crossedToLeft = motorcycle.lastX > screenCenter && motorcycle.x <= screenCenter; if ((crossedToRight || crossedToLeft) && !motorcycle.isFlipping) { motorcycle.isFlipping = true; // Flip the motorcycle by animating scaleX tween(motorcycle, { scaleX: -motorcycle.scaleX }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { motorcycle.isFlipping = false; } }); } motorcycle.lastX = motorcycle.x; } // Check projectile collisions for (var i = projectiles.length - 1; i >= 0; i--) { var projectile = projectiles[i]; // Remove off-screen projectiles if (projectile.x < -100 || projectile.x > 2148 || projectile.y > 2732 + 100) { projectile.destroy(); projectiles.splice(i, 1); continue; } // Check collision with motorcycle if (gameStarted && projectile.intersects(motorcycle)) { motorcycle.takeDamage(); projectile.destroy(); projectiles.splice(i, 1); continue; } // Check if projectile hits road (bounce or break) if (projectile.y >= roadY - 20 && projectile.velocityY > 0) { projectile.destroy(); projectiles.splice(i, 1); } } // Increase difficulty over time if (gameStarted && LK.ticks % 600 == 0) { // Every 10 seconds // Increase throw frequency for people objects for (var j = 0; j < roadsideObjects.length; j++) { if (roadsideObjects[j].objectType === 'person') { roadsideObjects[j].throwDelay = Math.max(20, roadsideObjects[j].throwDelay - 5); } } } };
===================================================================
--- original.js
+++ change.js
@@ -416,8 +416,33 @@
LK.setScore(distance);
}
// Update health display
healthTxt.setText('Health: ' + motorcycle.health);
+ // Check for motorcycle flip when crossing center line for perspective effect
+ if (gameStarted) {
+ if (motorcycle.lastX === undefined) {
+ motorcycle.lastX = motorcycle.x;
+ motorcycle.isFlipping = false;
+ }
+ // Check if motorcycle crossed from left half to right half or vice versa
+ var screenCenter = 1024;
+ var crossedToRight = motorcycle.lastX < screenCenter && motorcycle.x >= screenCenter;
+ var crossedToLeft = motorcycle.lastX > screenCenter && motorcycle.x <= screenCenter;
+ if ((crossedToRight || crossedToLeft) && !motorcycle.isFlipping) {
+ motorcycle.isFlipping = true;
+ // Flip the motorcycle by animating scaleX
+ tween(motorcycle, {
+ scaleX: -motorcycle.scaleX
+ }, {
+ duration: 200,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ motorcycle.isFlipping = false;
+ }
+ });
+ }
+ motorcycle.lastX = motorcycle.x;
+ }
// Check projectile collisions
for (var i = projectiles.length - 1; i >= 0; i--) {
var projectile = projectiles[i];
// Remove off-screen projectiles
Un grupo de gente manifestando a cuerpo completo mirando al frente enojada con banderas argentinas, todo en pixel art. In-Game asset. 2d. High contrast. No shadows
Una planta de lechuga en pixel art en el aire. In-Game asset. 2d. High contrast. No shadows
Un queso gruyere en pixel art. In-Game asset. 2d. High contrast. No shadows
moto
Music
gritos
Music
noEsUnaHuida
Sound effect
frase2
Sound effect
frase3
Sound effect
frase6
Sound effect
edge
Sound effect
frase1
Sound effect
frase4
Sound effect
frase5
Sound effect
hit
Sound effect
power_up
Sound effect
throw
Sound effect
piedra
Sound effect
altacoimera
Sound effect
alta
Music
cloaca
Sound effect
corruptosLoTuyos
Sound effect
frase7
Sound effect
queso
Sound effect
espert
Sound effect
afuera
Sound effect
level_complete
Sound effect
pill_throw
Sound effect
diaper_drop
Sound effect
bridge_level
Sound effect
miraConan
Sound effect