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
User prompt
El avance quedó parcialmente corregido, continúa por favor
User prompt
El efecto del avance esta mal resuelto, deben ser los bloques de ruta los que avancen, no la rura completa
User prompt
Ten en cuenta que en el horizonte deben juntarse en un punto horizontalmente y que la moto debe arrancar inmediatamente despues
User prompt
Las camionetas deben irse mas rapido y respetar la fuga de la perspectiva de la ruta, es decir desaparecer por el horizonte que está en la mitad
User prompt
La ruta debe mantener la misma forma en los costados debe haber 3 tipos de objetos, personas, arboles y carteles, que iran fugando hacia tras para dar la sencaacion de que la moto avanza
User prompt
La ruta debe comenzar debajo, y por debajo debe ocupar todo el ancho de la pantalla, hasta llegar a la mitad de la altura de la pantalla donde estaria el horizonte y la ruta se hace mas fina
User prompt
la ruta debe verse en perspectiva que se pierde en el horizonte, como un triangulo vertical
User prompt
el horizonte debe estar en la mitad de la pantalla y la ruta debe estar vertical en el medio
User prompt
esta mal el juego debe estar orientado hacia el horizonte como los juegos de moto arcade y la gente debe estar a la derecha y la izquierda
Code edit (1 edits merged)
Please save this source code
User prompt
Riot Road Runner
User prompt
cuando comienza, antes de que la moto pueda arrancar, dos camionetas deben alejarse hacia el horizonte, recien alli la moto comienza, en las banquinas debe haber gente que les arroja cosas como en una manifestacion
Initial prompt
quiero crear un juego de motos como el hang on de sega, pero el objetivo es ir esquivando obstaculos y agarrando items
/**** * 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.power = 100; // Power bar from 0-100% self.speed = 0; self.maxSpeed = 8; self.x = 129; 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 (damageAmount) { damageAmount = damageAmount || 3; // Default 3% damage self.power = Math.max(0, self.power - damageAmount); // Flash red when hit LK.effects.flashObject(self, 0xff0000, 500); LK.getSound('hit').play(); if (self.power <= 0) { LK.showGameOver(); } }; self.restorePower = function (amount) { amount = amount || 3; // Default 3% restoration self.power = Math.min(100, self.power + amount); LK.getSound('power_up').play(); }; return self; }); var PowerItem = Container.expand(function () { var self = Container.call(this); var itemGraphics = self.attachAsset('power_item', { anchorX: 0.5, anchorY: 0.5 }); self.velocityX = 0; self.velocityY = 0; self.gravity = 0.15; self.update = function () { self.x += self.velocityX; self.y += self.velocityY; self.velocityY += self.gravity; }; return self; }); var Projectile = Container.expand(function (isHeavy) { var self = Container.call(this); self.isHeavy = isHeavy || false; var assetName = self.isHeavy ? 'heavy_projectile' : 'projectile'; var projectileGraphics = self.attachAsset(assetName, { 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 + 400; // 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 } // 15% chance of throwing heavy projectile var isHeavy = Math.random() < 0.15; var projectile = new Projectile(isHeavy); 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.dropTimer = 0; self.dropDelay = 180; // Drop item every 3 seconds 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; // Drop power items periodically if (gameStarted) { self.dropTimer++; if (self.dropTimer >= self.dropDelay) { self.dropPowerItem(); self.dropTimer = 0; } } if (self.y > 400) { self.y = 400; } // Reset truck when it reaches horizon instead of deactivating } }; self.dropPowerItem = function () { var powerItem = new PowerItem(); powerItem.x = self.x + (Math.random() - 0.5) * 100; powerItem.y = self.y + 50; // Calculate trajectory toward road var targetX = motorcycle.x + (Math.random() - 0.5) * 300; var targetY = roadY; powerItem.velocityX = (targetX - powerItem.x) * 0.01; powerItem.velocityY = (targetY - powerItem.y) * 0.008; powerItems.push(powerItem); game.addChild(powerItem); }; 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 single truck ahead of motorcycle var trucks = []; var truck1 = game.addChild(new Truck()); truck1.x = 1024; truck1.y = roadY - 600; // Position far ahead trucks.push(truck1); // Create power bar UI var powerBarBg = LK.getAsset('power_bar_bg', { anchorX: 0.5, anchorY: 0.5, x: 1950, y: 400 }); LK.gui.center.addChild(powerBarBg); var powerBarFill = LK.getAsset('power_bar_fill', { anchorX: 0.5, anchorY: 1.0, x: 1950, y: 598 }); LK.gui.center.addChild(powerBarFill); var powerItems = []; // 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 to show power healthTxt.setText('Power: ' + Math.round(motorcycle.power) + '%'); // 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: 0, easing: tween.easeOut, onFinish: function onFinish() { motorcycle.isFlipping = false; } }); } motorcycle.lastX = motorcycle.x; } // Update power bar display var powerPercentage = motorcycle.power / 100; powerBarFill.scaleY = powerPercentage; if (powerPercentage > 0.6) { powerBarFill.tint = 0x00ff00; // Green } else if (powerPercentage > 0.3) { powerBarFill.tint = 0xffff00; // Yellow } else { powerBarFill.tint = 0xff0000; // Red } // 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)) { var damageAmount = projectile.isHeavy ? 50 : 3; // Heavy projectiles do 50% damage motorcycle.takeDamage(damageAmount); 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); } } // Check power item collisions for (var i = powerItems.length - 1; i >= 0; i--) { var powerItem = powerItems[i]; // Remove off-screen power items if (powerItem.x < -100 || powerItem.x > 2148 || powerItem.y > 2732 + 100) { powerItem.destroy(); powerItems.splice(i, 1); continue; } // Check collision with motorcycle if (gameStarted && powerItem.intersects(motorcycle)) { motorcycle.restorePower(3); // Restore 3% power powerItem.destroy(); powerItems.splice(i, 1); continue; } // Remove power items that hit the road if (powerItem.y >= roadY - 20 && powerItem.velocityY > 0) { powerItem.destroy(); powerItems.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
@@ -56,10 +56,8 @@
self.update = function () {
self.x += self.velocityX;
self.y += self.velocityY;
self.velocityY += self.gravity;
- // Rotate item for visual effect
- self.rotation += 0.08;
};
return self;
});
var Projectile = Container.expand(function (isHeavy) {
@@ -99,9 +97,9 @@
self.throwTimer++;
if (self.throwTimer >= self.throwDelay && gameStarted) {
self.throwObject();
self.throwTimer = 0;
- self.throwDelay = Math.random() * 120 + 400000000; // Next throw delay
+ self.throwDelay = Math.random() * 120 + 400; // Next throw delay
}
}
// Move object backward to simulate forward motion
if (gameStarted && motorcycle.speed > 0) {
@@ -182,15 +180,12 @@
self.dropPowerItem();
self.dropTimer = 0;
}
}
- // Reset truck when it reaches horizon instead of deactivating
- if (self.y <= horizonY) {
- self.y = roadY + 200; // Reset to behind motorcycle
- self.x = 1024; // Center position
- self.scaleX = 1;
- self.scaleY = 1;
+ if (self.y > 400) {
+ self.y = 400;
}
+ // Reset truck when it reaches horizon instead of deactivating
}
};
self.dropPowerItem = function () {
var powerItem = new PowerItem();
@@ -499,9 +494,9 @@
// Flip the motorcycle by animating scaleX
tween(motorcycle, {
scaleX: -motorcycle.scaleX
}, {
- duration: 200,
+ duration: 0,
easing: tween.easeOut,
onFinish: function onFinish() {
motorcycle.isFlipping = false;
}
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