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.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 Protester = Container.expand(function () { var self = Container.call(this); var protesterGraphics = self.attachAsset('protester', { anchorX: 0.5, anchorY: 1.0 }); self.throwTimer = 0; self.throwDelay = Math.random() * 180 + 60; // Random delay between throws self.isLeftSide = true; self.update = function () { self.throwTimer++; if (self.throwTimer >= self.throwDelay && gameStarted) { self.throwObject(); self.throwTimer = 0; self.throwDelay = Math.random() * 120 + 40; // Next throw delay } }; self.throwObject = function () { 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 = -2; self.active = true; self.update = function () { if (self.active) { self.y += self.speed; // Move toward horizon (upward on screen) // Also make trucks smaller as they go away var scale = Math.max(0.1, 1 - Math.abs(self.y - roadY) / 1000); self.scaleX = scale; self.scaleY = scale; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87ceeb }); /**** * Game Code ****/ var roadY = 1366; // Position road at middle of screen (2732/2) for horizon perspective var roadOffset = 0; var gameStarted = false; var trucksCleared = false; // Create road and sidewalks at middle of screen for horizon perspective var leftSidewalk = game.addChild(LK.getAsset('sidewalk', { anchorX: 0, anchorY: 0.5, x: 0, y: roadY })); var road = game.addChild(LK.getAsset('road', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: roadY })); var rightSidewalk = game.addChild(LK.getAsset('sidewalk', { anchorX: 1, anchorY: 0.5, x: 2048, y: roadY })); // 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 center road behind trucks var motorcycle = game.addChild(new Motorcycle()); motorcycle.x = 1024; motorcycle.y = roadY + 100; // Behind the trucks initially at center road // Create protesters var protesters = []; var projectiles = []; // Left side protesters positioned along the left sidewalk for (var i = 0; i < 12; i++) { var leftProtester = game.addChild(new Protester()); leftProtester.x = 100 + i * 80; leftProtester.y = roadY; leftProtester.isLeftSide = true; protesters.push(leftProtester); } // Right side protesters positioned along the right sidewalk for (var i = 0; i < 12; i++) { var rightProtester = game.addChild(new Protester()); rightProtester.x = 1600 + i * 80; rightProtester.y = roadY; rightProtester.isLeftSide = false; protesters.push(rightProtester); } // 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 road var roadLeft = road.x - road.width * 0.4; var roadRight = road.x + road.width * 0.4; 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 > -200) { allTrucksCleared = false; break; } } if (allTrucksCleared) { trucksCleared = true; gameStarted = true; } } // 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 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 // Spawn more protesters or increase throw frequency for (var j = 0; j < protesters.length; j++) { protesters[j].throwDelay = Math.max(20, protesters[j].throwDelay - 5); } } };
===================================================================
--- original.js
+++ change.js
@@ -116,13 +116,13 @@
/****
* Game Code
****/
-var roadY = 2200; // Position road at bottom for horizon perspective
+var roadY = 1366; // Position road at middle of screen (2732/2) for horizon perspective
var roadOffset = 0;
var gameStarted = false;
var trucksCleared = false;
-// Create road and sidewalks at bottom of screen for horizon perspective
+// Create road and sidewalks at middle of screen for horizon perspective
var leftSidewalk = game.addChild(LK.getAsset('sidewalk', {
anchorX: 0,
anchorY: 0.5,
x: 0,
@@ -148,12 +148,12 @@
var truck2 = game.addChild(new Truck());
truck2.x = 1150;
truck2.y = roadY;
trucks.push(truck1, truck2);
-// Create motorcycle at bottom of screen behind trucks
+// Create motorcycle at center road behind trucks
var motorcycle = game.addChild(new Motorcycle());
motorcycle.x = 1024;
-motorcycle.y = roadY + 100; // Behind the trucks initially at bottom
+motorcycle.y = roadY + 100; // Behind the trucks initially at center road
// Create protesters
var protesters = [];
var projectiles = [];
// Left side protesters positioned along the left sidewalk
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