User prompt
cambia la probabilidad a un 25 % de que te salte el jumscare y pon que al reiniciar a los 5 intentos tambien se reinicien los personajes osea que al reiniciar despues de los 5 intentos tengas que comprar todo otra vez , menos los personajes gratis , y tambien al intentar comprar un personaje y no tener esferas suficientes te coloque un texto en la pantalla que diga no tienes esferas suficientes. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
arregla el jumscare , lo que tienes que aser es que la imagen de jumscare se coloque en toda la pantalla del juego y cuando el jumscare se coloque en toda la pantalla se ponga el sonido jumscare , y elimina eso de que se agrande y se achique la imagen ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
que no se incremente la velocidad al tocar una esfera , eso es crucial , "no se aumenta la velocidad al tocar una esfera" , y cambia el valor de las esferas a 3 puntos por esfera , y cada 5 intentos se reinicie el puntaje acumulado ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
añade lo que te pedi
User prompt
pon el ganaste o win al llegar a los 50000 puntos y los puntos acumulados que solo se muestren en el apartado de la seleccion de personajes ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
camvia el valor de las esferas a 15 puntos al tocarlas y que los pinchos al llegar el tiempo a 0 cambiar el valor de daño de los pinchos a 25
User prompt
añade un contador abajo a la izquierda de 223 segundos , cuando el contador llege a 0 segundos que las pelotitas incrementen su velocidad sumando su mitad de velocidad , afectando a las esferas y a los pinchos , tambien añade que los puntos se guarden en el apartado de elegir tu personaje , costando desagrado 50 , miedo 340 , desagrado 500 , felicidad gratis , al terminar la partida los puntos acumulados en la parte superior en el medio seran sumados al contador de esferas de el apartado de seleccion de personajes , los puntos obtenidos , abra un texto que diga los precios de cada unos de los personajes , al tocar un personaje y no tener suficientes puntos no se podra elegir ese personaje , el precio de cada uno de los personaje al tener esferas sufucientes para obtener el personaje y añadirlo a la coleccion de los personajes que obtenga las esferas restantes de mis puntos acumulados seran restados al precio de cada personaje , al no tener esferas suficientes para comprar un personaje , el personaje no podra ser seleccionado ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
añade la imagen de jumscare y tambien su audio , al perder que haiga una provavilidad del 22.2 % de que salga en la pantalla agrandandose y achicandose , mientras que se reproduce su audio : jumscare ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
tiene que tener una jit box invisible en el texto de jugar en el cual al tocar en la jitbox de el texto JUGAR hay te lleve a elegir los personajes , y cada uno de los personajes tambien tienen que tener una jit box invisible y vien colocada para poder elegir a el personaje que querramos
User prompt
ahora quiero que al tocar la palabra jugar que ponga un texto que diga selecciona tu personaje , y abajo de el texto que esten los personajes de intensamente 1 para elegir y al tocar uno de ellos poder empesar a jugar con el , al elegir el personaje que eligamos que aiga una cuenta regresiva , 3, 2, 1, 0 , cuando el contador llege a 0 que empiese el juego
User prompt
antes de iniciar el juego tienes que poner un menu para empesar a jugar , al tocar la palabra jugar que te muestre las respectivas esferas con sus nombres cuales se encuentren estaticas en el sentro de la pantalla , y al seleccionar una de ellas se inicie con ese personaje y que tenga un contador regresivo de 3 segindos , 3 , 2 , 1 y que al llegar a 0 inicien a caer las esferas y los pinchos
User prompt
quiero que agreges un menu para poder elegir mi personaje segun las emociones que aiga para elegir , y que la velocidad de las esferas y de los pinchos aumenten poco a poco , para complicarlo un poco mas
User prompt
al tocar una esfera empesar a jugar con ese personaje , al iniciar el juego me gustaria que tenga una cuenta regresiva para iniciar a jugar , al iniciar el juego tiene que empesar a caer esferas de distintos colores , verde , azul , rojo y amarillo aleatoriamente y tambien una esfera nega con pinchos que te aga daño perdiendo vida progresivamente segun el puntaje que allas obtenido al recoger las esferas , cada esfera que obtengas sera un punto
User prompt
cambia las esferas por imagenes de los personajes , alegria por el sirculo amarillo , enojo por el sirculo rojo , desagrado por la esfera verde y miedo por la esfera purpura
User prompt
el juego tiene que estar en español
Code edit (1 edits merged)
Please save this source code
User prompt
Inside Out Memory Sphere Catcher
User prompt
la idea que tengo para crear el juego seria que haiga un personaje de intensamente el cual puedas seleccionar para cambiar de personaje y un menu de inicio , para iniciar a jugar tener opciones , EJ: vajar y suvir el volumen , y la idea es que caigan las esferas de recuerdos de intensamente 1 caigan de el cielo, y algunas corruptas o con espinas , las corruptas o con espinas que le agan daño a la personaje , el personaje tiene que ser alguno de la pelicula de intensamente 1 , alegria , enojo, desagrado o miedo, y que las esferas de recuerdos tengan un contador de puntos
Initial prompt
traduce todo lo que me digas al español
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var CorruptedMemory = Container.expand(function () {
var self = Container.call(this);
var memoryGraphics = self.attachAsset('corruptedMemory', {
anchorX: 0.5,
anchorY: 0.5
});
// Add spikes around the corrupted memory
var spike1 = self.attachAsset('spike', {
anchorX: 0.5,
anchorY: 0.5
});
spike1.x = -30;
spike1.y = -30;
spike1.rotation = Math.PI / 4;
var spike2 = self.attachAsset('spike', {
anchorX: 0.5,
anchorY: 0.5
});
spike2.x = 30;
spike2.y = -30;
spike2.rotation = -Math.PI / 4;
var spike3 = self.attachAsset('spike', {
anchorX: 0.5,
anchorY: 0.5
});
spike3.x = 30;
spike3.y = 30;
spike3.rotation = Math.PI / 4;
var spike4 = self.attachAsset('spike', {
anchorX: 0.5,
anchorY: 0.5
});
spike4.x = -30;
spike4.y = 30;
spike4.rotation = -Math.PI / 4;
self.speed = 4;
self.lastY = undefined;
self.update = function () {
self.y += self.speed;
};
return self;
});
var EmotionCharacter = Container.expand(function (emotionType) {
var self = Container.call(this);
var characterGraphics = self.attachAsset(emotionType, {
anchorX: 0.5,
anchorY: 0.5
});
self.emotionType = emotionType;
self.health = 100;
self.maxHealth = 100;
return self;
});
var GoldenMemory = Container.expand(function () {
var self = Container.call(this);
var memoryGraphics = self.attachAsset('goldenMemory', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 3;
self.lastY = undefined;
self.update = function () {
self.y += self.speed;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Background music
// Sound effects
// Memory sphere assets
// Character assets - Joy, Anger, Disgust, Fear
// If you need additional features, please specify what you'd like to add
// - Spike damage of 25 after timer expires
// - Win condition at 50000 points
// - Points accumulation (15 per sphere)
// - Character pricing and storage system
// - 223-second countdown timer with speed increase
// - Jumpscare with 22.2% probability on game over
// - Invisible hitboxes for JUGAR button and character selection
// All previously requested features have been successfully implemented:
var selectedEmotion = storage.selectedEmotion || 'joy';
var gameStarted = false;
var countdownActive = false;
var countdownValue = 3;
var character = null;
var goldenMemories = [];
var corruptedMemories = [];
var spawnTimer = 0;
var difficultyLevel = 1;
var health = 100;
var maxHealth = 100;
var jumpscareImage = null;
var jumpscareActive = false;
// Game state management
var gameState = 'menu'; // 'menu', 'characterSelection', 'countdown', 'playing'
var characterSelectionActive = false;
var selectionButtons = [];
// Timer variables
var gameTimer = 223; // 223 seconds
var timerActive = false;
var speedIncreased = false;
// Character pricing and spheres
var totalSpheres = storage.totalSpheres || 0;
var attemptCount = storage.attemptCount || 0;
var characterPrices = {
joy: 0,
// Free
disgust: 50,
fear: 340,
anger: 500
};
var ownedCharacters = storage.ownedCharacters || ['joy']; // Joy is free by default
// UI Elements
var scoreText = new Text2('Puntos: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
scoreText.alpha = 0; // Hide initially
LK.gui.top.addChild(scoreText);
var healthText = new Text2('Vida: 100/100', {
size: 50,
fill: 0xFF0000
});
healthText.anchor.set(1, 0);
LK.gui.topRight.addChild(healthText);
// Timer display
var timerText = new Text2('Tiempo: 223', {
size: 50,
fill: 0xFFFFFF
});
timerText.anchor.set(0, 1);
LK.gui.bottomLeft.addChild(timerText);
// Main Menu UI
var titleText = new Text2('INTENSAMENTE', {
size: 120,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
game.addChild(titleText);
var playButton = new Text2('JUGAR', {
size: 80,
fill: 0x00FF00
});
playButton.anchor.set(0.5, 0.5);
playButton.x = 1024;
playButton.y = 1200;
game.addChild(playButton);
var instructionText = new Text2('Selecciona tu personaje', {
size: 80,
fill: 0xFFFFFF
});
instructionText.anchor.set(0.5, 0.5);
instructionText.x = 1024;
instructionText.y = 600;
instructionText.alpha = 0;
game.addChild(instructionText);
var countdownText = new Text2('3', {
size: 200,
fill: 0xFFFFFF
});
countdownText.anchor.set(0.5, 0.5);
countdownText.x = 1024;
countdownText.y = 1366;
countdownText.alpha = 0;
game.addChild(countdownText);
// Spawn static character selection spheres in center
function spawnCharacterSelectionSpheres() {
// Only spawn once
if (goldenMemories.length === 0) {
var emotions = [{
type: 'joy',
name: 'ALEGRÍA',
color: 0xffeb3b,
x: 400,
y: 900
}, {
type: 'anger',
name: 'ENOJO',
color: 0xf44336,
x: 800,
y: 900
}, {
type: 'disgust',
name: 'DESAGRADO',
color: 0x4caf50,
x: 1200,
y: 900
}, {
type: 'fear',
name: 'MIEDO',
color: 0x9c27b0,
x: 1600,
y: 900
}];
// Hide score text in character selection
scoreText.alpha = 0;
// Add spheres counter display
var spheresText = new Text2('Esferas: ' + totalSpheres, {
size: 60,
fill: 0xFFD700
});
spheresText.anchor.set(0.5, 0.5);
spheresText.x = 1024;
spheresText.y = 500;
game.addChild(spheresText);
for (var i = 0; i < emotions.length; i++) {
var emotionData = emotions[i];
var emotionMemory = new GoldenMemory();
emotionMemory.x = emotionData.x;
emotionMemory.y = emotionData.y;
emotionMemory.characterType = emotionData.type;
emotionMemory.children[0].tint = emotionData.color;
emotionMemory.speed = 0; // Static spheres
goldenMemories.push(emotionMemory);
game.addChild(emotionMemory);
// Check if character is owned or affordable
var isOwned = ownedCharacters.indexOf(emotionData.type) !== -1;
var canAfford = totalSpheres >= characterPrices[emotionData.type];
var price = characterPrices[emotionData.type];
// Dim sphere if not owned and can't afford
if (!isOwned && !canAfford) {
emotionMemory.alpha = 0.3;
}
// Add text label with price
var labelText = emotionData.name;
if (!isOwned) {
labelText += '\nPrecio: ' + price + ' esferas';
} else {
labelText += '\nDISPONIBLE';
}
var nameText = new Text2(labelText, {
size: 35,
fill: isOwned ? 0x00FF00 : canAfford ? 0xFFFFFF : 0xFF6666
});
nameText.anchor.set(0.5, 0.5);
nameText.x = emotionData.x;
nameText.y = emotionData.y + 150;
game.addChild(nameText);
emotionMemory.nameText = nameText;
emotionMemory.isOwned = isOwned;
emotionMemory.canAfford = canAfford;
}
}
}
// Handle sphere selection for character choice
function handleSphereSelection(sphere) {
if (sphere.characterType) {
var characterType = sphere.characterType;
var isOwned = ownedCharacters.indexOf(characterType) !== -1;
var canAfford = totalSpheres >= characterPrices[characterType];
var price = characterPrices[characterType];
// Check if character can be selected
if (!isOwned && !canAfford) {
// Flash red to indicate can't select
LK.effects.flashObject(sphere, 0xFF0000, 500);
// Show insufficient spheres message
var errorText = new Text2('No tienes esferas suficientes', {
size: 60,
fill: 0xFF0000
});
errorText.anchor.set(0.5, 0.5);
errorText.x = 1024;
errorText.y = 1366;
game.addChild(errorText);
// Remove error message after 2 seconds
LK.setTimeout(function () {
errorText.destroy();
}, 2000);
return;
}
// If not owned but can afford, purchase the character
if (!isOwned && canAfford) {
totalSpheres -= price;
ownedCharacters.push(characterType);
storage.totalSpheres = totalSpheres;
storage.ownedCharacters = ownedCharacters;
}
selectedEmotion = characterType;
storage.selectedEmotion = selectedEmotion;
// Flash selected sphere
LK.effects.flashObject(sphere, 0xFFFFFF, 500);
// Clear all spheres and their labels
for (var i = goldenMemories.length - 1; i >= 0; i--) {
if (goldenMemories[i].nameText) {
goldenMemories[i].nameText.destroy();
}
goldenMemories[i].destroy();
goldenMemories.splice(i, 1);
}
// Hide instruction text
instructionText.alpha = 0;
// Start countdown
LK.setTimeout(function () {
startCountdown();
}, 600);
}
}
// Start character selection
function startCharacterSelection() {
gameState = 'characterSelection';
// Hide menu elements
titleText.alpha = 0;
playButton.alpha = 0;
// Show instruction text
instructionText.alpha = 1;
// Spawn character selection spheres
spawnCharacterSelectionSpheres();
}
// Start countdown before game
function startCountdown() {
gameState = 'countdown';
countdownActive = true;
countdownValue = 3;
instructionText.alpha = 0;
countdownText.alpha = 1;
countdownText.setText('3');
var countdownInterval = LK.setInterval(function () {
countdownValue--;
if (countdownValue > 0) {
countdownText.setText(countdownValue.toString());
} else if (countdownValue === 0) {
countdownText.setText('¡Juega!');
} else {
LK.clearInterval(countdownInterval);
countdownText.alpha = 0;
startActualGame();
}
}, 1000);
}
// Show jumpscare covering full screen
function showJumpscare() {
if (jumpscareActive) return; // Prevent multiple jumpscares
jumpscareActive = true;
// Create jumpscare image covering full screen
jumpscareImage = LK.getAsset('jumscare', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 5.12,
// Scale to cover 2048px width (2048/400 = 5.12)
scaleY: 6.83 // Scale to cover 2732px height (2732/400 = 6.83)
});
jumpscareImage.x = 1024; // Center horizontally
jumpscareImage.y = 1366; // Center vertically
game.addChild(jumpscareImage);
// Play jumpscare sound immediately
LK.getSound('jumscare').play();
// Keep jumpscare visible for 1.5 seconds then fade out
LK.setTimeout(function () {
tween(jumpscareImage, {
alpha: 0
}, {
duration: 500,
easing: tween.easeIn,
onFinish: function onFinish() {
if (jumpscareImage) {
jumpscareImage.destroy();
jumpscareImage = null;
}
jumpscareActive = false;
}
});
}, 1000);
}
// Start the actual game
function startActualGame() {
gameState = 'playing';
countdownActive = false;
gameStarted = true;
// Initialize timer
gameTimer = 223;
timerActive = true;
speedIncreased = false;
// Show score text during gameplay
scoreText.alpha = 1;
// Create player character
character = new EmotionCharacter(selectedEmotion);
character.x = 1024;
character.y = 2400;
game.addChild(character);
// Start background music
LK.playMusic('gameMusic');
}
// Spawn memory function
function spawnMemory() {
if (gameState === 'characterSelection') {
// Character selection phase - spawn static character spheres in center
spawnCharacterSelectionSpheres();
} else if (gameState === 'playing') {
// Game phase - spawn colored spheres and corrupted ones
var spawnX = Math.random() * (2048 - 160) + 80;
var randomType = Math.random();
if (randomType < 0.15) {
// Yellow sphere
var yellowMemory = new GoldenMemory();
yellowMemory.x = spawnX;
yellowMemory.y = -100;
yellowMemory.lastY = yellowMemory.y;
yellowMemory.children[0].tint = 0xffeb3b;
goldenMemories.push(yellowMemory);
game.addChild(yellowMemory);
} else if (randomType < 0.3) {
// Green sphere
var greenMemory = new GoldenMemory();
greenMemory.x = spawnX;
greenMemory.y = -100;
greenMemory.lastY = greenMemory.y;
greenMemory.children[0].tint = 0x4caf50;
goldenMemories.push(greenMemory);
game.addChild(greenMemory);
} else if (randomType < 0.45) {
// Blue sphere
var blueMemory = new GoldenMemory();
blueMemory.x = spawnX;
blueMemory.y = -100;
blueMemory.lastY = blueMemory.y;
blueMemory.children[0].tint = 0x2196f3;
goldenMemories.push(blueMemory);
game.addChild(blueMemory);
} else if (randomType < 0.6) {
// Red sphere
var redMemory = new GoldenMemory();
redMemory.x = spawnX;
redMemory.y = -100;
redMemory.lastY = redMemory.y;
redMemory.children[0].tint = 0xf44336;
goldenMemories.push(redMemory);
game.addChild(redMemory);
} else {
// Corrupted memory with spikes
var corrupted = new CorruptedMemory();
corrupted.x = spawnX;
corrupted.y = -100;
corrupted.lastY = corrupted.y;
corruptedMemories.push(corrupted);
game.addChild(corrupted);
}
}
}
// Game event handlers
game.down = function (x, y, obj) {
if (gameState === 'menu') {
// Check if JUGAR button was clicked with invisible hitbox
var playButtonX = playButton.x - playButton.width / 2;
var playButtonY = playButton.y - playButton.height / 2;
var playButtonWidth = playButton.width;
var playButtonHeight = playButton.height;
if (x >= playButtonX && x <= playButtonX + playButtonWidth && y >= playButtonY && y <= playButtonY + playButtonHeight) {
startCharacterSelection();
}
} else if (gameState === 'characterSelection') {
// Check if any character sphere was clicked with invisible hitboxes
for (var i = 0; i < goldenMemories.length; i++) {
var sphere = goldenMemories[i];
var sphereX = sphere.x - 60; // Sphere width is 120, so half is 60
var sphereY = sphere.y - 60; // Sphere height is 120, so half is 60
var sphereWidth = 120;
var sphereHeight = 120;
if (x >= sphereX && x <= sphereX + sphereWidth && y >= sphereY && y <= sphereY + sphereHeight) {
handleSphereSelection(sphere);
break;
}
}
}
};
game.move = function (x, y, obj) {
if (gameStarted && character) {
character.x = Math.max(60, Math.min(1988, x));
}
};
// Start spawning spheres for character selection
// Main game update loop
game.update = function () {
// Handle different game states
if (gameState === 'menu') {
return; // No updates needed in menu
}
if (gameState === 'characterSelection') {
// Static spheres, no updates needed
return;
}
if (gameState === 'countdown') {
return; // Countdown handles itself
}
if (gameState !== 'playing') {
return;
}
// Update timer
if (timerActive && LK.ticks % 60 === 0) {
// Update every second (60 ticks = 1 second at 60 FPS)
gameTimer--;
timerText.setText('Tiempo: ' + gameTimer);
// When timer reaches 0, increase speed
if (gameTimer <= 0 && !speedIncreased) {
speedIncreased = true;
timerActive = false;
// Increase speed by adding half of current speed
for (var t = 0; t < goldenMemories.length; t++) {
goldenMemories[t].speed += goldenMemories[t].speed * 0.5;
}
for (var u = 0; u < corruptedMemories.length; u++) {
corruptedMemories[u].speed += corruptedMemories[u].speed * 0.5;
}
}
}
// Game playing state - spawn spheres
spawnTimer++;
var spawnRate = Math.max(30, 90 - difficultyLevel * 5);
if (spawnTimer >= spawnRate) {
spawnMemory();
spawnTimer = 0;
}
// Increase difficulty over time
if (LK.getScore() > 0 && LK.getScore() % 10 === 0) {
difficultyLevel = Math.floor(LK.getScore() / 10) + 1;
}
// Spawn rate already handled at top of update function
// Update golden memories
for (var i = goldenMemories.length - 1; i >= 0; i--) {
var golden = goldenMemories[i];
// Initialize lastY if needed
if (golden.lastY === undefined) golden.lastY = golden.y;
// Check if off screen
if (golden.lastY <= 2732 && golden.y > 2732) {
golden.destroy();
goldenMemories.splice(i, 1);
continue;
}
// Check collision with character for game phase
if (character && golden.intersects(character) && gameStarted) {
LK.setScore(LK.getScore() + 3);
scoreText.setText('Puntos: ' + LK.getScore());
LK.getSound('collect').play();
// Flash character gold
LK.effects.flashObject(character, 0xFFD700, 300);
golden.destroy();
goldenMemories.splice(i, 1);
continue;
}
// Check collision for character selection phase
if (!gameStarted && !countdownActive && golden.characterType) {
var bounds = golden.getBounds();
// Check if sphere was touched (simplified touch detection)
if (golden.y > 500 && golden.y < 2000) {
handleSphereSelection(golden);
golden.destroy();
goldenMemories.splice(i, 1);
continue;
}
}
golden.lastY = golden.y;
}
// Update corrupted memories
for (var j = corruptedMemories.length - 1; j >= 0; j--) {
var corrupted = corruptedMemories[j];
// Initialize lastY if needed
if (corrupted.lastY === undefined) corrupted.lastY = corrupted.y;
// Check if off screen
if (corrupted.lastY <= 2732 && corrupted.y > 2732) {
corrupted.destroy();
corruptedMemories.splice(j, 1);
continue;
}
// Check collision with character
if (character && corrupted.intersects(character)) {
var damage = speedIncreased ? 25 : 20;
health -= damage;
healthText.setText('Vida: ' + health + '/' + maxHealth);
LK.getSound('damage').play();
// Flash character red
LK.effects.flashObject(character, 0xFF0000, 500);
corrupted.destroy();
corruptedMemories.splice(j, 1);
// Check game over
if (health <= 0) {
// Increment attempt counter
attemptCount++;
storage.attemptCount = attemptCount;
// Reset accumulated points every 5 attempts
if (attemptCount % 5 === 0) {
totalSpheres = 0;
storage.totalSpheres = 0;
// Reset owned characters except free ones
ownedCharacters = ['joy'];
storage.ownedCharacters = ownedCharacters;
} else {
// Add accumulated points to total spheres
totalSpheres += LK.getScore();
storage.totalSpheres = totalSpheres;
}
// 25% chance of jumpscare
if (Math.random() < 0.25) {
showJumpscare();
// Delay game over to let jumpscare play
LK.setTimeout(function () {
LK.showGameOver();
}, 1500);
} else {
LK.showGameOver();
}
return;
}
continue;
}
corrupted.lastY = corrupted.y;
}
// Increase memory speed based on difficulty
for (var k = 0; k < goldenMemories.length; k++) {
var baseSpeed = 3 + difficultyLevel * 0.5;
if (speedIncreased) {
baseSpeed += baseSpeed * 0.5; // Add half speed when timer expired
}
goldenMemories[k].speed = baseSpeed;
}
for (var l = 0; l < corruptedMemories.length; l++) {
var baseSpeed = 4 + difficultyLevel * 0.5;
if (speedIncreased) {
baseSpeed += baseSpeed * 0.5; // Add half speed when timer expired
}
corruptedMemories[l].speed = baseSpeed;
}
// Check win condition (score of 50000)
if (LK.getScore() >= 50000) {
// Increment attempt counter
attemptCount++;
storage.attemptCount = attemptCount;
// Reset accumulated points every 5 attempts
if (attemptCount % 5 === 0) {
totalSpheres = 0;
storage.totalSpheres = 0;
// Reset owned characters except free ones
ownedCharacters = ['joy'];
storage.ownedCharacters = ownedCharacters;
} else {
// Add accumulated points to total spheres
totalSpheres += LK.getScore();
storage.totalSpheres = totalSpheres;
}
LK.showYouWin();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -274,8 +274,21 @@
// Check if character can be selected
if (!isOwned && !canAfford) {
// Flash red to indicate can't select
LK.effects.flashObject(sphere, 0xFF0000, 500);
+ // Show insufficient spheres message
+ var errorText = new Text2('No tienes esferas suficientes', {
+ size: 60,
+ fill: 0xFF0000
+ });
+ errorText.anchor.set(0.5, 0.5);
+ errorText.x = 1024;
+ errorText.y = 1366;
+ game.addChild(errorText);
+ // Remove error message after 2 seconds
+ LK.setTimeout(function () {
+ errorText.destroy();
+ }, 2000);
return;
}
// If not owned but can afford, purchase the character
if (!isOwned && canAfford) {
@@ -587,15 +600,18 @@
// Reset accumulated points every 5 attempts
if (attemptCount % 5 === 0) {
totalSpheres = 0;
storage.totalSpheres = 0;
+ // Reset owned characters except free ones
+ ownedCharacters = ['joy'];
+ storage.ownedCharacters = ownedCharacters;
} else {
// Add accumulated points to total spheres
totalSpheres += LK.getScore();
storage.totalSpheres = totalSpheres;
}
- // 22.2% chance of jumpscare
- if (Math.random() < 0.222) {
+ // 25% chance of jumpscare
+ if (Math.random() < 0.25) {
showJumpscare();
// Delay game over to let jumpscare play
LK.setTimeout(function () {
LK.showGameOver();
@@ -632,8 +648,11 @@
// Reset accumulated points every 5 attempts
if (attemptCount % 5 === 0) {
totalSpheres = 0;
storage.totalSpheres = 0;
+ // Reset owned characters except free ones
+ ownedCharacters = ['joy'];
+ storage.ownedCharacters = ownedCharacters;
} else {
// Add accumulated points to total spheres
totalSpheres += LK.getScore();
storage.totalSpheres = totalSpheres;