User prompt
saca los cultistas, que esten las llaves en los cofres y que te pueda tocar llave o bateria
User prompt
que alla baterias para la linterna en cofres por el mapa y que tengas que pegarle a un cultista para que te de una llave para salvar a un niño, en el mapa van a haber 4 cultistas ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
cuando rescato a un niño el lobo valla mas rapido y yo por 3 segundos voy mas lento ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
pero cuando libero un niño que el lobo corra mas rapido hasta donde estoy
User prompt
mejor tengo que agarrar a los 4 niños pero necesito llaves para rescartarlos y cuando agarro un niño el ciervo salga corriendo hasta donde estoy y apretando dos veces caminar prenda la linterna
User prompt
no avanzan los dias
User prompt
rescate dos niños y me conto un dia nomas, estana en el dia 2 y en vez de pasar al dia 4 pase al 3
User prompt
pero no gano cuando rescato a todos los niños, gano cuando llego a los 99 dias, cuando rescato un niño hace que cuando pase un dia cuente por 2 dias si rescato otro por 3 dias y si rescato otro por 4 dia
User prompt
cuanto me mate el ciervo que se reinicie el personaje y los dias y que el ciervo se mueva por todo el mapa
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'batteryText.style.fill = "#FFFF00";' Line Number: 454
Code edit (1 edits merged)
Please save this source code
User prompt
99 Nights in the Forest: The Cursed Stag
Initial prompt
Nombre del Juego: 99 Noches en el Bosque: La Maldición del Ciervo (Survival Horror / Misión de Rescate) Género: Survival Horror (terror atmosférico y persecuciones). Misión de rescate con elementos de sigilo y exploración. Multijugador cooperativo (hasta 4 jugadores, cada uno controla un buscador). Ambientación: Un bosque maldito envuelto en niebla perpetua, con árboles retorcidos y sonidos de animales distorsionados. Puntos clave: Una aldea abandonada, una iglesia en ruinas (nido del ciervo), cuevas con pistas y 4 "refugios" donde están atrapados los niños. Tiempo dinámico: Las noches son largas y peligrosas; los días breves permiten prepararse. Historia (Lore): Hace años, un cazador profanó un santuario ancestral y fue maldecido, transformándose en El Ciervo Endemoniado, una criatura que camina en dos patas y arrastra cadenas oxidadas. Ahora, secuestra niños para "protegerlos" en su bosque. Los jugadores deben rescatarlos antes de la Noche 99, cuando el ciervo los sacrificará en un ritual. Mecánicas Principales: El Ciervo Endemoniado (Antagonista): Movimiento: Camina erguido, pero corre en 4 patas al perseguir. Sus ojos brillan en la oscuridad. Comportamiento: Reacciona al sonido (pasos, objetos rotos). Canta una canción de cuna distorsionada cuando está cerca (pista auditiva). Si te ve, golpea el suelo para paralizar al jugador unos segundos. Debilidad: Luces brillantes (linternas potentes) lo aturden temporalmente. Objetivo Principal: Encontrar a 4 niños (cada uno en una zona diferente del bosque): Luna: Atrapada en una jaula colgante (requiere resolver un puzzle de pesos). Tomás: Escondido en una cueva con trampas de raíces. Ana: Poseída por el bosque (hay que purificarla con un objeto sagrado). Leo: Secuestrado en el altar de la iglesia (zona final). Supervivencia y Recursos: Linterna recargable: Usa baterías limitadas (el ciervo la odia). Radio de comunicación: Para coordinar con otros jugadores (a veces capta voces extrañas). Objetos clave: Tijeras de podar: Cortar raíces que bloquean caminos. Salvia sagrada: Aleja al ciervo por 10 segundos. Mapa fragmentado: Se completa al explorar. Cooperación Obligatoria: Algunos niños solo se rescatan con acciones simultáneas (ej: dos jugadores deben activar interruptores). Si un jugador es "capturado" por el ciervo, los demás deben liberarlo antes de que lo lleve a su nido. Progresión: Cada niño rescatado reduce la agresividad del ciervo pero aumenta su desesperación (persigue más rápido en noches posteriores). En la Noche 99, si no han rescatado a todos, el ciervo inicia el ritual y los jugadores deben enfrentarlo en un escape final. Elementos Únicos: Sistema de "Alerta del Ciervo": Un ícono en pantalla muestra si está cerca (similar al sistema de Amnesia). Huellas sangrientas: Aparecen aleatoriamente para guiar (o engañar) a los jugadores. Flashbacks: Al encontrar objetos de los niños, se ven recuerdos que explican su secuestro. Estilo Visual y Sonido: Arte inspirado en folklore eslavo: El ciervo tiene astas retorcidas y un cuerpo semihumano. Sonidos: Cadenas arrastrándose cuando el ciervo se mueve. Risitas de niños falsas (para confundir). Música: Cánticos distorsionados y cuerdas tensas. Finales Posibles: Final Bueno: Rescatan a los 4 niños y escapan al amanecer. Final Neutral: Escapan pero dejan a un niño (el ciervo ruge a lo lejos). Final Maldito: Todos son atrapados; la pantalla muestra "99 Noches cumplidas". Instrucciones para la IA (si es para generación): Modela al ciervo con animaciones fluidas (transición entre 2 y 4 patas). Programa los refugios de los niños como zonas con puzzles únicos. Añade un sistema de cordura si los jugadores ven al ciervo demasiado tiempo (visión borrosa). Usa trigger zones para eventos de persecución (ej: si el ciervo entra en la iglesia, las puertas se cierran).
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Chest = Container.expand(function (containsKey) { var self = Container.call(this); var chestGraphics = self.attachAsset('village', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.3, scaleY: 0.3 }); chestGraphics.tint = 0x8B4513; // Brown color for chest self.collected = false; self.containsKey = containsKey || false; self.batteryAmount = 50; self.collect = function () { if (!self.collected) { self.collected = true; self.visible = false; if (self.containsKey) { player.keyCount++; LK.setScore(LK.getScore() + 10); } else { player.batteryLevel = Math.min(100, player.batteryLevel + self.batteryAmount); LK.setScore(LK.getScore() + 15); } } }; return self; }); var Child = Container.expand(function (childName) { var self = Container.call(this); var childGraphics = self.attachAsset('child', { anchorX: 0.5, anchorY: 0.5 }); self.name = childName || 'Child'; self.isRescued = false; self.detectionRadius = 80; var nameText = new Text2(self.name, { size: 24, fill: 0xFFFFFF }); nameText.anchor.set(0.5, 1); nameText.y = -40; self.addChild(nameText); self.rescue = function () { if (!self.isRescued && player.keyCount > 0) { self.isRescued = true; childGraphics.tint = 0x90EE90; LK.getSound('childFound').play(); LK.setScore(LK.getScore() + 25); player.keyCount--; rescuedChildren++; // Make stag run to player when child is rescued and increase its speed if (stag) { stag.isHunting = true; stag.huntingTarget = player; stag.speed += 0.5; // Increase stag speed when child is rescued } // Make player slower for 3 seconds if (player) { var originalSpeed = player.speed; player.speed = originalSpeed * 0.5; // Reduce speed to half tween(player, { speed: originalSpeed }, { duration: 3000 }); } checkWinCondition(); } }; return self; }); var Fog = Container.expand(function () { var self = Container.call(this); var fogGraphics = self.attachAsset('fog', { anchorX: 0.5, anchorY: 0.5, alpha: 0.6 }); self.driftSpeed = 0.5; self.driftDirection = Math.random() * Math.PI * 2; self.update = function () { self.x += Math.cos(self.driftDirection) * self.driftSpeed; self.y += Math.sin(self.driftDirection) * self.driftSpeed; if (self.x < -150) self.x = 2200; if (self.x > 2200) self.x = -150; if (self.y < -150) self.y = 2900; if (self.y > 2900) self.y = -150; if (Math.random() < 0.01) { self.driftDirection += (Math.random() - 0.5) * 0.5; } }; return self; }); var Key = Container.expand(function () { var self = Container.call(this); var keyGraphics = self.attachAsset('sage', { anchorX: 0.5, anchorY: 0.5 }); keyGraphics.tint = 0xFFD700; // Gold color for keys self.collected = false; self.collect = function () { if (!self.collected) { self.collected = true; self.visible = false; player.keyCount++; LK.setScore(LK.getScore() + 10); } }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 3; self.isMoving = false; self.flashlightOn = false; self.batteryLevel = 100; self.sageCount = 0; self.keyCount = 0; self.isParalyzed = false; self.paralyzedTimer = 0; var flashlightBeam = self.addChild(LK.getAsset('flashlightBeam', { anchorX: 0.5, anchorY: 1.0, alpha: 0 })); self.update = function () { if (self.isParalyzed) { self.paralyzedTimer--; if (self.paralyzedTimer <= 0) { self.isParalyzed = false; playerGraphics.tint = 0xFFFFFF; } return; } if (self.flashlightOn && self.batteryLevel > 0) { self.batteryLevel -= 0.2; flashlightBeam.alpha = Math.min(1, self.batteryLevel / 100); flashlightBeam.y = -20; } else { flashlightBeam.alpha = 0; } if (self.batteryLevel <= 0) { self.flashlightOn = false; } }; self.toggleFlashlight = function () { if (self.batteryLevel > 0) { self.flashlightOn = !self.flashlightOn; LK.getSound('flashlightClick').play(); } }; self.paralyze = function () { self.isParalyzed = true; self.paralyzedTimer = 180; playerGraphics.tint = 0x666666; }; self.die = function () { // Reset game state resetGame(); }; return self; }); var Sage = Container.expand(function () { var self = Container.call(this); var sageGraphics = self.attachAsset('sage', { anchorX: 0.5, anchorY: 0.5 }); self.collected = false; self.collect = function () { if (!self.collected) { self.collected = true; self.visible = false; player.sageCount++; LK.setScore(LK.getScore() + 5); } }; return self; }); var Stag = Container.expand(function () { var self = Container.call(this); var stagGraphics = self.attachAsset('stag', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 1.5; self.detectionRadius = 250; self.attackRadius = 100; self.isHunting = false; self.huntingTarget = null; self.chainsTimer = 0; self.isStunned = false; self.stunnedTimer = 0; self.wanderDirection = Math.random() * Math.PI * 2; self.wanderTimer = 0; self.wanderSpeed = 0.8; self.update = function () { if (self.isStunned) { self.stunnedTimer--; if (self.stunnedTimer <= 0) { self.isStunned = false; stagGraphics.alpha = 1; } return; } self.chainsTimer++; if (self.chainsTimer >= 300) { LK.getSound('stagChains').play(); self.chainsTimer = 0; } if (player && !player.isParalyzed) { var distanceToPlayer = Math.sqrt(Math.pow(self.x - player.x, 2) + Math.pow(self.y - player.y, 2)); if (player.flashlightOn && distanceToPlayer < 200) { self.stun(); return; } if (distanceToPlayer < self.detectionRadius) { self.isHunting = true; self.huntingTarget = player; } if (self.isHunting && self.huntingTarget) { var dx = self.huntingTarget.x - self.x; var dy = self.huntingTarget.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 5) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } if (distance < self.attackRadius) { self.huntingTarget.die(); self.isHunting = false; self.huntingTarget = null; } } else { // Wander around the map when not hunting self.wanderTimer++; if (self.wanderTimer >= 120) { self.wanderDirection = Math.random() * Math.PI * 2; self.wanderTimer = 0; } self.x += Math.cos(self.wanderDirection) * self.wanderSpeed; self.y += Math.sin(self.wanderDirection) * self.wanderSpeed; // Keep stag within map bounds if (self.x < 50) { self.x = 50; self.wanderDirection = Math.random() * Math.PI * 2; } if (self.x > 1998) { self.x = 1998; self.wanderDirection = Math.random() * Math.PI * 2; } if (self.y < 50) { self.y = 50; self.wanderDirection = Math.random() * Math.PI * 2; } if (self.y > 2682) { self.y = 2682; self.wanderDirection = Math.random() * Math.PI * 2; } } } }; self.stun = function () { self.isStunned = true; self.stunnedTimer = 120; self.isHunting = false; self.huntingTarget = null; stagGraphics.alpha = 0.5; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ // Initialize game assets // Game variables var player; var stag; var children = []; var fogElements = []; var sageElements = []; var environments = []; var keyElements = []; var chestElements = []; var rescuedChildren = 0; var lastTapTime = 0; var tapCount = 0; var gameNight = 1; var isGameActive = true; var dayProgress = 0; // UI elements var scoreText = new Text2('Score: 0', { size: 40, fill: 0xFFFFFF }); scoreText.anchor.set(0, 0); LK.gui.topRight.addChild(scoreText); var nightText = new Text2('Night: 1/99', { size: 40, fill: 0xFFFFFF }); nightText.anchor.set(0.5, 0); LK.gui.top.addChild(nightText); var batteryText = new Text2('Battery: 100%', { size: 30, fill: 0xFFFF00 }); batteryText.anchor.set(0, 0); batteryText.x = 20; batteryText.y = 80; LK.gui.topLeft.addChild(batteryText); var sageText = new Text2('Sage: 0', { size: 30, fill: 0x90EE90 }); sageText.anchor.set(0, 0); sageText.x = 20; sageText.y = 120; LK.gui.topLeft.addChild(sageText); var keyText = new Text2('Keys: 0', { size: 30, fill: 0xFFD700 }); keyText.anchor.set(0, 0); keyText.x = 20; keyText.y = 160; LK.gui.topLeft.addChild(keyText); var instructionText = new Text2('Tap to move. Double tap to toggle flashlight.', { size: 24, fill: 0xCCCCCC }); instructionText.anchor.set(0.5, 1); LK.gui.bottom.addChild(instructionText); // Initialize game elements function initializeGame() { // Create player player = game.addChild(new Player()); player.x = 1024; player.y = 2000; // Create stag stag = game.addChild(new Stag()); stag.x = 200; stag.y = 200; // Create environments var church = game.addChild(LK.getAsset('church', { anchorX: 0.5, anchorY: 0.5, x: 300, y: 400 })); environments.push(church); var village = game.addChild(LK.getAsset('village', { anchorX: 0.5, anchorY: 0.5, x: 1600, y: 600 })); environments.push(village); var cave = game.addChild(LK.getAsset('cave', { anchorX: 0.5, anchorY: 0.5, x: 1200, y: 1800 })); environments.push(cave); // Create trees for (var i = 0; i < 15; i++) { var tree = game.addChild(LK.getAsset('tree', { anchorX: 0.5, anchorY: 0.5, x: Math.random() * 2048, y: Math.random() * 2732 })); environments.push(tree); } // Create children to rescue var childNames = ['Luna', 'Tomás', 'Ana', 'Leo']; var childPositions = [{ x: 350, y: 450 }, { x: 1650, y: 650 }, { x: 1250, y: 1850 }, { x: 800, y: 1200 }]; for (var j = 0; j < 4; j++) { var child = game.addChild(new Child(childNames[j])); child.x = childPositions[j].x; child.y = childPositions[j].y; children.push(child); } // Create fog for (var k = 0; k < 12; k++) { var fog = game.addChild(new Fog()); fog.x = Math.random() * 2048; fog.y = Math.random() * 2732; fogElements.push(fog); } // Create sage items for (var l = 0; l < 8; l++) { var sage = game.addChild(new Sage()); sage.x = Math.random() * 1800 + 100; sage.y = Math.random() * 2400 + 100; sageElements.push(sage); } // Create chests that contain either keys or batteries for (var m = 0; m < 10; m++) { var containsKey = Math.random() < 0.4; // 40% chance for key, 60% for battery var chest = game.addChild(new Chest(containsKey)); chest.x = Math.random() * 1800 + 100; chest.y = Math.random() * 2400 + 100; chestElements.push(chest); } } // Movement variables var targetX = null; var targetY = null; var pressStartTime = 0; var isLongPress = false; function checkWinCondition() { if (rescuedChildren >= 4) { LK.showYouWin(); } } function checkLoseCondition() { // No lose condition - reaching 99 days is now winning } function resetGame() { // Reset game variables rescuedChildren = 0; gameNight = 1; isGameActive = true; dayProgress = 0; // Clear existing game objects for (var i = game.children.length - 1; i >= 0; i--) { var child = game.children[i]; game.removeChild(child); if (child.destroy) { child.destroy(); } } // Clear arrays children.length = 0; fogElements.length = 0; sageElements.length = 0; keyElements.length = 0; chestElements.length = 0; environments.length = 0; // Reset score LK.setScore(0); // Re-initialize game initializeGame(); } // Event handlers game.down = function (x, y, obj) { pressStartTime = LK.ticks; isLongPress = false; targetX = x; targetY = y; }; game.up = function (x, y, obj) { var currentTime = LK.ticks; var pressDuration = currentTime - pressStartTime; if (pressDuration <= 30 && !isLongPress) { // Check for double tap if (currentTime - lastTapTime < 30 && tapCount === 1) { // Double tap detected - toggle flashlight player.toggleFlashlight(); tapCount = 0; } else { // Single tap - set movement target and start tap count targetX = x; targetY = y; tapCount = 1; lastTapTime = currentTime; } } }; game.move = function (x, y, obj) { if (!isLongPress && LK.ticks - pressStartTime < 30) { targetX = x; targetY = y; } }; // Main game update loop game.update = function () { if (!isGameActive) return; // Move player toward target if (targetX !== null && targetY !== null && !player.isParalyzed) { var dx = targetX - player.x; var dy = targetY - player.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 10) { player.x += dx / distance * player.speed; player.y += dy / distance * player.speed; player.isMoving = true; if (LK.ticks % 30 === 0) { LK.getSound('footstep').play(); } } else { player.isMoving = false; targetX = null; targetY = null; } } // Keep player in bounds player.x = Math.max(50, Math.min(1998, player.x)); player.y = Math.max(50, Math.min(2682, player.y)); // Check child rescue interactions for (var i = 0; i < children.length; i++) { var child = children[i]; if (!child.isRescued) { var distanceToChild = Math.sqrt(Math.pow(player.x - child.x, 2) + Math.pow(player.y - child.y, 2)); if (distanceToChild < child.detectionRadius) { child.rescue(); } } } // Check sage collection for (var j = 0; j < sageElements.length; j++) { var sage = sageElements[j]; if (!sage.collected) { var distanceToSage = Math.sqrt(Math.pow(player.x - sage.x, 2) + Math.pow(player.y - sage.y, 2)); if (distanceToSage < 40) { sage.collect(); } } } // Check key collection for (var k = 0; k < keyElements.length; k++) { var key = keyElements[k]; if (!key.collected) { var distanceToKey = Math.sqrt(Math.pow(player.x - key.x, 2) + Math.pow(player.y - key.y, 2)); if (distanceToKey < 40) { key.collect(); } } } // Check chest collection for (var l = 0; l < chestElements.length; l++) { var chest = chestElements[l]; if (!chest.collected) { var distanceToChest = Math.sqrt(Math.pow(player.x - chest.x, 2) + Math.pow(player.y - chest.y, 2)); if (distanceToChest < 40) { chest.collect(); } } } // Advance night every 30 seconds (1800 ticks) with acceleration based on rescued children var dayAcceleration = rescuedChildren + 1; // 1x speed with 0 children, 2x with 1 child, etc. // Add acceleration to day progress dayProgress += dayAcceleration; // Check if a full day has passed (1800 ticks worth of progress) if (dayProgress >= 1800) { gameNight++; stag.speed += 0.1; dayProgress -= 1800; // Reset progress but keep overflow checkWinCondition(); // Check win condition instead of lose } // Reset tap count if too much time has passed if (LK.ticks - lastTapTime > 30) { tapCount = 0; } // Update UI scoreText.setText('Score: ' + LK.getScore()); nightText.setText('Night: ' + gameNight + '/99'); batteryText.setText('Battery: ' + Math.ceil(player.batteryLevel) + '%'); sageText.setText('Sage: ' + player.sageCount); keyText.setText('Keys: ' + player.keyCount); // Battery color warning if (player.batteryLevel < 25) { batteryText.tint = 0xFF0000; } else if (player.batteryLevel < 50) { batteryText.tint = 0xFFAA00; } else { batteryText.tint = 0xFFFF00; } }; // Initialize the game initializeGame(); // Start ambient music LK.playMusic('forestAmbient');
===================================================================
--- original.js
+++ change.js
@@ -6,9 +6,9 @@
/****
* Classes
****/
-var Battery = Container.expand(function () {
+var Chest = Container.expand(function (containsKey) {
var self = Container.call(this);
var chestGraphics = self.attachAsset('village', {
anchorX: 0.5,
anchorY: 0.5,
@@ -16,15 +16,21 @@
scaleY: 0.3
});
chestGraphics.tint = 0x8B4513; // Brown color for chest
self.collected = false;
+ self.containsKey = containsKey || false;
self.batteryAmount = 50;
self.collect = function () {
if (!self.collected) {
self.collected = true;
self.visible = false;
- player.batteryLevel = Math.min(100, player.batteryLevel + self.batteryAmount);
- LK.setScore(LK.getScore() + 15);
+ if (self.containsKey) {
+ player.keyCount++;
+ LK.setScore(LK.getScore() + 10);
+ } else {
+ player.batteryLevel = Math.min(100, player.batteryLevel + self.batteryAmount);
+ LK.setScore(LK.getScore() + 15);
+ }
}
};
return self;
});
@@ -72,111 +78,8 @@
}
};
return self;
});
-var Cultist = Container.expand(function () {
- var self = Container.call(this);
- var cultistGraphics = self.attachAsset('stag', {
- anchorX: 0.5,
- anchorY: 0.5,
- scaleX: 0.5,
- scaleY: 0.5
- });
- cultistGraphics.tint = 0x800080; // Purple color for cultist
- self.health = 3;
- self.isDefeated = false;
- self.detectionRadius = 100;
- self.attackRadius = 80;
- self.speed = 1;
- self.wanderDirection = Math.random() * Math.PI * 2;
- self.wanderTimer = 0;
- self.hitCooldown = 0;
- self.down = function (x, y, obj) {
- if (!self.isDefeated && self.hitCooldown <= 0) {
- self.takeDamage();
- }
- };
- self.takeDamage = function () {
- if (!self.isDefeated) {
- self.health--;
- self.hitCooldown = 30; // 0.5 second cooldown
- tween(cultistGraphics, {
- tint: 0xFF0000
- }, {
- duration: 200,
- onFinish: function onFinish() {
- tween(cultistGraphics, {
- tint: 0x800080
- }, {
- duration: 200
- });
- }
- });
- if (self.health <= 0) {
- self.defeat();
- }
- }
- };
- self.defeat = function () {
- self.isDefeated = true;
- cultistGraphics.alpha = 0.3;
- // Drop a key at cultist location
- var droppedKey = game.addChild(new Key());
- droppedKey.x = self.x;
- droppedKey.y = self.y;
- keyElements.push(droppedKey);
- LK.setScore(LK.getScore() + 20);
- };
- self.update = function () {
- if (self.isDefeated) return;
- if (self.hitCooldown > 0) {
- self.hitCooldown--;
- }
- if (player && !player.isParalyzed) {
- var distanceToPlayer = Math.sqrt(Math.pow(self.x - player.x, 2) + Math.pow(self.y - player.y, 2));
- if (distanceToPlayer < self.detectionRadius) {
- // Move towards player
- var dx = player.x - self.x;
- var dy = player.y - self.y;
- var distance = Math.sqrt(dx * dx + dy * dy);
- if (distance > 5) {
- self.x += dx / distance * self.speed;
- self.y += dy / distance * self.speed;
- }
- if (distance < self.attackRadius) {
- player.paralyze();
- }
- } else {
- // Wander around
- self.wanderTimer++;
- if (self.wanderTimer >= 180) {
- self.wanderDirection = Math.random() * Math.PI * 2;
- self.wanderTimer = 0;
- }
- self.x += Math.cos(self.wanderDirection) * 0.5;
- self.y += Math.sin(self.wanderDirection) * 0.5;
- // Keep cultist within map bounds
- if (self.x < 50) {
- self.x = 50;
- self.wanderDirection = Math.random() * Math.PI * 2;
- }
- if (self.x > 1998) {
- self.x = 1998;
- self.wanderDirection = Math.random() * Math.PI * 2;
- }
- if (self.y < 50) {
- self.y = 50;
- self.wanderDirection = Math.random() * Math.PI * 2;
- }
- if (self.y > 2682) {
- self.y = 2682;
- self.wanderDirection = Math.random() * Math.PI * 2;
- }
- }
- }
- };
- return self;
-});
var Fog = Container.expand(function () {
var self = Container.call(this);
var fogGraphics = self.attachAsset('fog', {
anchorX: 0.5,
@@ -400,10 +303,9 @@
var fogElements = [];
var sageElements = [];
var environments = [];
var keyElements = [];
-var batteryElements = [];
-var cultistElements = [];
+var chestElements = [];
var rescuedChildren = 0;
var lastTapTime = 0;
var tapCount = 0;
var gameNight = 1;
@@ -528,35 +430,16 @@
sage.x = Math.random() * 1800 + 100;
sage.y = Math.random() * 2400 + 100;
sageElements.push(sage);
}
- // Create batteries in chests around the map
- for (var m = 0; m < 6; m++) {
- var battery = game.addChild(new Battery());
- battery.x = Math.random() * 1800 + 100;
- battery.y = Math.random() * 2400 + 100;
- batteryElements.push(battery);
+ // Create chests that contain either keys or batteries
+ for (var m = 0; m < 10; m++) {
+ var containsKey = Math.random() < 0.4; // 40% chance for key, 60% for battery
+ var chest = game.addChild(new Chest(containsKey));
+ chest.x = Math.random() * 1800 + 100;
+ chest.y = Math.random() * 2400 + 100;
+ chestElements.push(chest);
}
- // Create 4 cultists that drop keys when defeated
- var cultistPositions = [{
- x: 500,
- y: 800
- }, {
- x: 1500,
- y: 1000
- }, {
- x: 800,
- y: 1600
- }, {
- x: 1200,
- y: 400
- }];
- for (var n = 0; n < 4; n++) {
- var cultist = game.addChild(new Cultist());
- cultist.x = cultistPositions[n].x;
- cultist.y = cultistPositions[n].y;
- cultistElements.push(cultist);
- }
}
// Movement variables
var targetX = null;
var targetY = null;
@@ -588,10 +471,9 @@
children.length = 0;
fogElements.length = 0;
sageElements.length = 0;
keyElements.length = 0;
- batteryElements.length = 0;
- cultistElements.length = 0;
+ chestElements.length = 0;
environments.length = 0;
// Reset score
LK.setScore(0);
// Re-initialize game
@@ -681,15 +563,15 @@
key.collect();
}
}
}
- // Check battery collection
- for (var l = 0; l < batteryElements.length; l++) {
- var battery = batteryElements[l];
- if (!battery.collected) {
- var distanceToBattery = Math.sqrt(Math.pow(player.x - battery.x, 2) + Math.pow(player.y - battery.y, 2));
- if (distanceToBattery < 40) {
- battery.collect();
+ // Check chest collection
+ for (var l = 0; l < chestElements.length; l++) {
+ var chest = chestElements[l];
+ if (!chest.collected) {
+ var distanceToChest = Math.sqrt(Math.pow(player.x - chest.x, 2) + Math.pow(player.y - chest.y, 2));
+ if (distanceToChest < 40) {
+ chest.collect();
}
}
}
// Advance night every 30 seconds (1800 ticks) with acceleration based on rescued children
roblox player. In-Game asset. 2d. High contrast. No shadows
Cabeza de Ciervo: La figura posee una cabeza detallada de ciervo, con astas ramificadas de color oscuro (posiblemente negro o marrón oscuro). Tiene orejas puntiagudas y un hocico prominente de un tono más claro que el resto del cuerpo. Los ojos son grandes, completamente blancos con pupilas negras pequeñas y redondas, lo que le confiere una mirada vacía y sorprendente. La boca está abierta en una expresión que podría interpretarse como un grito o una mueca. Cuerpo Humanoide: El cuerpo es de forma vagamente humana, con dos brazos largos y delgados que terminan en manos con lo que parecen ser garras o dedos muy alargados. Las piernas son también delgadas y la postura sugiere que está de pie. El color del cuerpo es principalmente marrón oscuro o morado oscuro.. In-Game asset. 2d. High contrast. No shadows
child roblox hat dinosaur red. In-Game asset. 2d. High contrast. No shadows
tree. In-Game asset. 2d. High contrast. No shadows
fog. In-Game asset. 2d. High contrast. No shadows
cave. In-Game asset. 2d. High contrast. No shadows
church gris. In-Game asset. 2d. High contrast. No shadows
sage. In-Game asset. 2d. High contrast. No shadows
roblox player corriendo de stag con miedo y una linterna en la mano. In-Game asset. 2d. High contrast. No shadows
cofre. In-Game asset. 2d. High contrast. No shadows
armario. In-Game asset. 2d. High contrast. No shadows
Cabeza de Ciervo: La figura posee una cabeza detallada de ciervo, con astas ramificadas de color oscuro (posiblemente negro o marrón oscuro). Tiene orejas puntiagudas y un hocico prominente de un tono más claro que el resto del cuerpo. Los ojos son grandes, completamente blancos con pupilas rojas gigantes y redondas, lo que le confiere una mirada vacía y sorprendente. La boca está abierta en una expresión que podría interpretarse como un grito o una mueca. Cuerpo Humanoide: El cuerpo es de forma vagamente humana, con dos brazos largos y delgados que terminan en manos con lo que parecen ser garras o dedos muy alargados. Las piernas son también delgadas y la postura sugiere que está de pie. El color del cuerpo es principalmente marrón oscuro o morado oscuro.. In-Game asset. 2d. High contrast. No shadows
house. In-Game asset. 2d. High contrast. No shadows