User prompt
La cantidad de tarros que sea ilimitada, que bajen menos tarros ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Que los tarros no se generen de golpe. Se generan de 10 en 10, y bajan de poco a poco ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Que los tarros no bajen de golpe, que bajen de poco a poco ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Te dije que bajes la cantidad de tarros para entrar a la dimensión a solo cien
User prompt
Baja el número de tarros a solo cien para poder entrar a la otra dimensión
User prompt
Que cada tarro valga 100, al inicio volvere a tener 0 tarros
User prompt
Generame de una vez con mil tarros
User prompt
Quítale las coordenadas y agrégale un fondo
User prompt
Agrégale un dónde
User prompt
Quítale un 25% de tamaño al oso
User prompt
Que el lo se encuentre más arriba
User prompt
Los tarros a la mitad de su tamaño y el oso el doble de grande
User prompt
Tra vez el doble de grande
User prompt
Que el oso sea el doble de grande y que se encuentre un poco abajo del suelo
User prompt
El oso que sea 50% más grande
User prompt
Que los tarros sean un poco más continuos, y un 25% más grande
User prompt
Que el sueño se divida en tres partes, para que el pasto no se distorsiones
User prompt
El tarro si el oso no lo atrapa, al caer al suelo explotará
User prompt
Pon un suelo donde se encuentre el oso, solo se puede mover de izquierda a derecha
User prompt
Pon un sueño donde se encuentre el oso y que los tarros caigan
Code edit (1 edits merged)
Please save this source code
User prompt
Honey Bear's Dimensional Quest
Initial prompt
El juego se trata de un oso que nesecita comer miel, después de mil tarros de miel entrara a la dimensión de la miel, dónde terminara el juego
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bear = Container.expand(function () { var self = Container.call(this); var bearGraphics = self.attachAsset('bear', { anchorX: 0.5, anchorY: 0.5 }); return self; }); var HoneyJar = Container.expand(function () { var self = Container.call(this); var jarGraphics = self.attachAsset('honeyJar', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.fallSpeed = 3; self.floatOffset = Math.random() * Math.PI * 2; self.floatAmount = 1 + Math.random(); self.targetY = 2432; // Ground level where bear is positioned self.isFalling = false; // Start the gradual falling animation self.startFalling = function () { if (self.isFalling || self.collected) return; self.isFalling = true; // Calculate fall duration based on distance and speed var fallDistance = self.targetY - self.y; var fallDuration = fallDistance / self.fallSpeed * 16.67; // Convert to milliseconds (60fps) tween(self, { y: self.targetY }, { duration: fallDuration, easing: tween.linear, onFinish: function onFinish() { // Create explosion effect when hitting ground LK.effects.flashObject(self, 0xff4500, 500); // Orange flash for explosion // Animate explosion with scale tween(self, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { self.destroy(); } }); // Remove from honeyJars array for (var i = honeyJars.length - 1; i >= 0; i--) { if (honeyJars[i] === self) { honeyJars.splice(i, 1); break; } } } }); }; self.update = function () { if (self.collected) return; // Add gentle side-to-side floating like in a dream if (self.isFalling) { self.x += Math.sin(LK.ticks * 0.02 + self.floatOffset) * self.floatAmount; } // Remove jar if it falls off screen (backup cleanup) if (self.y > 2800) { for (var i = honeyJars.length - 1; i >= 0; i--) { if (honeyJars[i] === self) { honeyJars.splice(i, 1); break; } } self.destroy(); } }; self.collect = function () { if (self.collected) return; self.collected = true; // Stop falling animation tween.stop(self, { y: true }); // Animate collection with scale and fade tween(self, { scaleX: 0, scaleY: 0, alpha: 0 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { self.destroy(); } }); // Play collect sound LK.getSound('collect').play(); // Update score honeyCount += 1; LK.setScore(honeyCount); scoreTxt.setText(honeyCount + ' / 100'); // Check for victory if (honeyCount >= 100) { triggerHoneyDimension(); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xE6E6FA // Dreamy lavender sky color }); /**** * Game Code ****/ var bear; var honeyJars = []; var honeyCount = 0; var dragNode = null; var spawnTimer = 0; var gameWon = false; var jarsSpawned = 0; var jarBatchSize = 5; // Reduced from 10 to 5 var batchSpawnInterval = 2000; // Increased from 1000ms to 2000ms for less frequent spawning // Create UI var scoreTxt = new Text2('0 / 100', { size: 80, fill: 0x8B4513 }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Create background var background = game.addChild(LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5 })); background.x = 1024; // Center horizontally background.y = 1366; // Center vertically // Create three ground segments to prevent distortion var ground1 = game.addChild(LK.getAsset('ground', { anchorX: 0.5, anchorY: 0 })); ground1.x = 341; // Left third (683/2) ground1.y = 2532; // Bottom of screen (2732 - 200) var ground2 = game.addChild(LK.getAsset('ground', { anchorX: 0.5, anchorY: 0 })); ground2.x = 1024; // Center third ground2.y = 2532; // Bottom of screen (2732 - 200) var ground3 = game.addChild(LK.getAsset('ground', { anchorX: 0.5, anchorY: 0 })); ground3.x = 1707; // Right third (2048 - 683/2) ground3.y = 2532; // Bottom of screen (2732 - 200) // Create bear bear = game.addChild(new Bear()); bear.x = 1024; // Center horizontally bear.y = 2432; // Higher up, at ground level for quadruple-sized bear function spawnHoneyJar() { var jar = new HoneyJar(); // Spawn from top of screen at random X position (adjusted for half-sized jars) jar.x = 50 + Math.random() * (2048 - 100); jar.y = -50; // Start above screen jar.fallSpeed = 3 + Math.random() * 4; // Random fall speed between 3-7 honeyJars.push(jar); game.addChild(jar); // Add gentle spawn animation jar.scaleX = 0.8; jar.scaleY = 0.8; tween(jar, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { // Start falling animation after spawn animation completes jar.startFalling(); } }); } function triggerHoneyDimension() { if (gameWon) return; gameWon = true; // Play victory sound LK.getSound('victory').play(); // Create spectacular visual effects game.setBackgroundColor(0xFFD700); // Golden background // Flash effect LK.effects.flashScreen(0xFFFFFF, 1000); // Scale up bear for dramatic effect tween(bear, { scaleX: 2, scaleY: 2 }, { duration: 1500, easing: tween.easeInOut }); // Rotate bear tween(bear, { rotation: Math.PI * 4 }, { duration: 2000, easing: tween.easeInOut }); // Show victory after effects LK.setTimeout(function () { LK.showYouWin(); }, 2500); } function handleMove(x, y, obj) { if (dragNode && !gameWon) { dragNode.x = x; // Keep bear on ground - no vertical movement dragNode.y = 2432; // Keep bear within screen bounds horizontally only (adjusted for smaller bear) dragNode.x = Math.max(270, Math.min(1778, dragNode.x)); } } // Event handlers game.move = handleMove; game.down = function (x, y, obj) { if (!gameWon) { dragNode = bear; handleMove(x, y, obj); } }; game.up = function (x, y, obj) { dragNode = null; }; // Main game loop game.update = function () { if (gameWon) return; // No periodic spawning needed - all jars spawned at start // Check collisions between bear and honey jars for (var i = honeyJars.length - 1; i >= 0; i--) { var jar = honeyJars[i]; if (!jar.collected && bear.intersects(jar)) { jar.collect(); honeyJars.splice(i, 1); } } }; // Start the gradual spawning process function startGradualSpawning() { var _spawnBatch = function spawnBatch() { // Spawn current batch of jars for (var i = 0; i < jarBatchSize; i++) { // Add slight delay between jars in the same batch (function (index) { LK.setTimeout(function () { spawnHoneyJar(); jarsSpawned++; }, index * 200); // 200ms delay between each jar in batch })(i); } // Schedule next batch (unlimited spawning) LK.setTimeout(_spawnBatch, batchSpawnInterval); }; // Start the first batch _spawnBatch(); } // Start gradual spawning startGradualSpawning();
===================================================================
--- original.js
+++ change.js
@@ -128,12 +128,11 @@
var honeyCount = 0;
var dragNode = null;
var spawnTimer = 0;
var gameWon = false;
-var totalJarsToSpawn = 100;
var jarsSpawned = 0;
-var jarBatchSize = 10;
-var batchSpawnInterval = 1000; // 1 second between batches
+var jarBatchSize = 5; // Reduced from 10 to 5
+var batchSpawnInterval = 2000; // Increased from 1000ms to 2000ms for less frequent spawning
// Create UI
var scoreTxt = new Text2('0 / 100', {
size: 80,
fill: 0x8B4513
@@ -257,24 +256,20 @@
};
// Start the gradual spawning process
function startGradualSpawning() {
var _spawnBatch = function spawnBatch() {
- var batchEnd = Math.min(jarsSpawned + jarBatchSize, totalJarsToSpawn);
- for (var i = jarsSpawned; i < batchEnd; i++) {
+ // Spawn current batch of jars
+ for (var i = 0; i < jarBatchSize; i++) {
// Add slight delay between jars in the same batch
(function (index) {
LK.setTimeout(function () {
- if (jarsSpawned < totalJarsToSpawn) {
- spawnHoneyJar();
- jarsSpawned++;
- }
- }, (index - jarsSpawned) * 100); // 100ms delay between each jar in batch
+ spawnHoneyJar();
+ jarsSpawned++;
+ }, index * 200); // 200ms delay between each jar in batch
})(i);
}
- // Schedule next batch if we haven't spawned all jars yet
- if (jarsSpawned < totalJarsToSpawn) {
- LK.setTimeout(_spawnBatch, batchSpawnInterval);
- }
+ // Schedule next batch (unlimited spawning)
+ LK.setTimeout(_spawnBatch, batchSpawnInterval);
};
// Start the first batch
_spawnBatch();
}
Tarro de miel con un poco de ella desbordandose. In-Game asset. 2d. High contrast. No shadows
Oso naranja de pelaje con pecho y osico amarillo, al igual que un nariz azul, quiero que tenga un poco de miel en su boca y que mire hacia arriba. In-Game asset. 2d. High contrast. No shadows
Cielo azul con un sol con lentes de sol. In-Game asset. 2d. High contrast. No shadows