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.update = function () {
if (self.collected) return;
// Fall down with gentle floating motion
self.y += self.fallSpeed;
// Add gentle side-to-side floating like in a dream
self.x += Math.sin(LK.ticks * 0.02 + self.floatOffset) * self.floatAmount;
// Check if jar hits the ground (explodes)
if (self.y >= 2432) {
// Ground level where bear is positioned
// Create explosion effect
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;
}
}
}
// 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;
// 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++;
LK.setScore(honeyCount);
scoreTxt.setText(honeyCount + ' / 1000');
// Check for victory
if (honeyCount >= 1000) {
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;
// Create UI
var scoreTxt = new Text2('0 / 1000', {
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
});
}
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;
// Spawn honey jars periodically - dream-like rain
spawnTimer++;
if (spawnTimer >= 30) {
// Every 0.5 seconds at 60fps for more continuous rain
spawnTimer = 0;
if (honeyJars.length < 10) {
// Keep max 10 jars on screen for more continuous dream effect
spawnHoneyJar();
}
}
// 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);
}
}
};
// Spawn initial honey jars
for (var i = 0; i < 3; i++) {
LK.setTimeout(function () {
spawnHoneyJar();
}, i * 500);
} ===================================================================
--- original.js
+++ change.js
@@ -117,16 +117,15 @@
fill: 0x8B4513
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
-// Create position display
-var positionTxt = new Text2('Posición: X: 1024, Y: 2432', {
- size: 60,
- fill: 0x8B4513
-});
-positionTxt.anchor.set(0.5, 0);
-positionTxt.y = 100; // Position below score
-LK.gui.top.addChild(positionTxt);
+// 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
@@ -219,10 +218,8 @@
};
// Main game loop
game.update = function () {
if (gameWon) return;
- // Update position display
- positionTxt.setText('Posición: X: ' + Math.round(bear.x) + ', Y: ' + Math.round(bear.y));
// Spawn honey jars periodically - dream-like rain
spawnTimer++;
if (spawnTimer >= 30) {
// Every 0.5 seconds at 60fps for more continuous rain
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