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
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.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 = 2200; // Position road at bottom for horizon perspective var roadOffset = 0; var gameStarted = false; var trucksCleared = false; // Create road and sidewalks at bottom 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 bottom of screen behind trucks var motorcycle = game.addChild(new Motorcycle()); motorcycle.x = 1024; motorcycle.y = roadY + 100; // Behind the trucks initially at bottom // 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
@@ -74,14 +74,14 @@
self.throwObject = function () {
var projectile = new Projectile();
projectile.x = self.x;
projectile.y = self.y - 20;
- // Calculate trajectory toward road center
- var targetX = 1024 + (Math.random() - 0.5) * 400; // Road center with some variance
- var targetY = roadY + 50;
- projectile.velocityX = (targetX - projectile.x) * 0.02;
- projectile.velocityY = (targetY - projectile.y) * 0.02;
- projectile.gravity = 0.3;
+ // 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();
};
@@ -96,9 +96,13 @@
self.speed = -2;
self.active = true;
self.update = function () {
if (self.active) {
- self.y += self.speed;
+ 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;
});
@@ -112,13 +116,13 @@
/****
* Game Code
****/
-var roadY = 1366; // Center of screen vertically
+var roadY = 2200; // Position road at bottom for horizon perspective
var roadOffset = 0;
var gameStarted = false;
var trucksCleared = false;
-// Create road and sidewalks
+// Create road and sidewalks at bottom of screen for horizon perspective
var leftSidewalk = game.addChild(LK.getAsset('sidewalk', {
anchorX: 0,
anchorY: 0.5,
x: 0,
@@ -135,37 +139,37 @@
anchorY: 0.5,
x: 2048,
y: roadY
}));
-// Create trucks
+// 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
+// Create motorcycle at bottom of screen behind trucks
var motorcycle = game.addChild(new Motorcycle());
motorcycle.x = 1024;
-motorcycle.y = roadY + 150; // Behind the trucks initially
+motorcycle.y = roadY + 100; // Behind the trucks initially at bottom
// Create protesters
var protesters = [];
var projectiles = [];
-// Left side protesters
-for (var i = 0; i < 8; i++) {
+// Left side protesters positioned along the left sidewalk
+for (var i = 0; i < 12; i++) {
var leftProtester = game.addChild(new Protester());
- leftProtester.x = 200 + i * 150;
- leftProtester.y = roadY - 100;
+ leftProtester.x = 100 + i * 80;
+ leftProtester.y = roadY;
leftProtester.isLeftSide = true;
protesters.push(leftProtester);
}
-// Right side protesters
-for (var i = 0; i < 8; i++) {
+// Right side protesters positioned along the right sidewalk
+for (var i = 0; i < 12; i++) {
var rightProtester = game.addChild(new Protester());
- rightProtester.x = 1400 + i * 150;
- rightProtester.y = roadY - 100;
+ rightProtester.x = 1600 + i * 80;
+ rightProtester.y = roadY;
rightProtester.isLeftSide = false;
protesters.push(rightProtester);
}
// Score display
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