User prompt
I want you to remove the start menu or title screen completely from my game E.L.Y.S. — Energy Linking Your System. The game should start directly in the main gameplay scene, with no “Play” button or menu. Keep all current gameplay mechanics, movement, energy linking, enemies, effects, background, and visual style.
User prompt
The current version of my game E.L.Y.S. — Energy Linking Your System has a beautiful main menu, but it is not functional. Please fix the logic and connection between the menu and the game. Keep all the visuals, background, buttons, text, and animations exactly as they are, but: Make the Play button start the actual gameplay scene where the player controls E.L.Y.S. Make the About button open a pop-up window with information about the world and game goal. Make the Exit button close or fade out the menu screen. If needed, reconnect the “Game Scene” or “Main Level” scene so everything loads correctly. Make sure that pressing “Play” shows a short transition (fade-out or energy flash) and then the player can move again. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fix the main menu functionality of the game E.L.Y.S. — Energy Linking Your System. Keep the current visuals and animations, but make all buttons fully functional. When the Play button is clicked, it must start the main game scene where the player controls E.L.Y.S. When the About button is clicked, it must show a short info panel about the world and gameplay. When the Exit button is clicked, it must return to the title screen or close the menu. Add a smooth fade-out transition between the main menu and the game. Keep the glowing, futuristic style and all current visual effects. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fix the main menu functionality of the game E.L.Y.S. — Energy Linking Your System. Keep the current visuals and animations, but make all buttons fully functional. When the Play button is clicked, it must start the main game scene where the player controls E.L.Y.S. When the About button is clicked, it must show a short info panel about the world and gameplay. When the Exit button is clicked, it must return to the title screen or close the menu. Add a smooth fade-out transition between the main menu and the game. Keep the glowing, futuristic style and all current visual effects. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
🧠 Objective: You already created a game called E.L.Y.S. — Energy Linking Your System, but now I want to improve and upgrade it without changing the original gameplay concept. The main idea is to balance biological energy inside a cell and bring life back to a dying world. Please keep the existing game logic, but completely enhance the visual design, interface, and flow so it feels alive, smooth, and professional. The entire game must remain in English, and it should look visually stunning and futuristic. 🌈 Visual and Style Enhancements Redesign everything with a bioluminescent aesthetic (neon pink, electric blue, gold and black tones). Add depth to the background: glowing particles, soft light rays, energy lines moving slowly. Make the main character (the cell, E.L.Y.S.) shine and pulsate with smooth motion. All UI elements (ATP bar, score, molecules, etc.) must have neon outlines and gentle animations. Add subtle sound effects (soft hums, clicks, pulse sounds) when energy is gained or lost. 🧩 Main Menu (Fix and Improve It) The main menu must be fully functional. Add background animation: floating orbs, glowing energy flow, and a breathing effect in the center. Show the game logo: E.L.Y.S. — Energy Linking Your System in elegant glowing text. Add three buttons: Play: starts the game scene (connect to gameplay properly). About: shows a short description of the world and purpose of the game. Exit: closes the menu or goes back to title screen. Add hover effects: buttons glow brighter or expand slightly when the cursor passes over them. When you press “Play”, the screen should fade out with a light pulse transition and then start the main level. ⚙️ Gameplay Improvements Keep the same logic of energy balance (ATP, molecules, etc.), but make it visually clear. Add short text hints like: “Collect molecules to stabilize energy.” “Too much energy can cause chaos.” Smooth player movement, with gentle acceleration and glowing trail. Add sound feedback when collecting or losing energy. Add small visual effects when the player’s energy bar changes color (green for stable, red for danger). 🧬 Educational Touch Keep the link to biology and metabolism visible but artistic. Make each collected element correspond to something biological (glucose, oxygen, enzymes). When balance is reached, make the background bloom with light — representing the rebirth of life. 🎵 Audio and Mood Add ambient background music: soft, ethereal, with electronic and organic tones. Music changes slightly when the player loses or gains balance (darker or brighter tones). Add sound effects for transitions and button clicks in the menu. 💫 Final Touch Add a fade-out animation when the game is over, showing the phrase: “Energy restored. Life connected.” Make sure the restart button works and brings the player back to the main menu smoothly. Everything should feel alive, reactive, and cinematic — not static or flat. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
haz estas mejoras En un planeta antiguo y silencioso, una sola chispa de vida llamada E.L.Y.S. despierta en medio de la oscuridad. El mundo está colapsando por el desequilibrio entre la energía vital (creación) y la energía caótica (destrucción). E.L.Y.S. debe recuperar el balance energético reconstruyendo los procesos metabólicos que alguna vez sostuvieron la vida. A medida que avanza, el entorno cambia visualmente, pasando de un paisaje oscuro y muerto a un mundo luminoso, lleno de energía en movimiento. ⚡ El enfoque es emocional, visual y educativo, pero el jugador se siente como si estuviera jugando una historia épica en miniatura. ⸻ 🧩 Pantalla de inicio (Main Menu) • Fondo dinámico con una atmósfera viva: luces pulsantes, partículas que flotan, y un núcleo brillante en el centro. • El título debe aparecer con movimiento: E.L.Y.S. — Energy Linking Your System • Tres botones flotantes con brillo: 1. Begin Journey 2. Continue 3. About E.L.Y.S. • Al presionar “Begin Journey”, se ve una cinemática breve: Una chispa cae del cielo y toca el suelo, naciendo una célula brillante que respira por primera vez. ⸻ 🎮 Jugabilidad • El jugador controla a E.L.Y.S., una célula flotante bioluminiscente que se mueve libremente en un ambiente tipo líquido. • Debe absorber energía de partículas flotantes (moléculas) y evitar ondas oscuras (toxinas). • La energía del jugador se mide en una barra luminosa (ATP bar). • Si recolecta demasiada energía, el entorno se vuelve caótico (efecto visual rojo); si tiene muy poca, el entorno se apaga. • El reto es mantener el equilibrio energético. Cada acción tiene efectos visuales bellos: cuando E.L.Y.S. absorbe energía, el entorno florece con luces, raíces brillantes y sonidos de chispa. Los controles deben sentirse suaves, flotantes, naturales. ⸻ 🧠 Progresión y niveles El juego tiene 5 mundos, cada uno representando un proceso biológico real. 1️⃣ Cytoplasm Caverns – Aprende a moverte y absorber energía básica. 2️⃣ Mitochondrial Core – Descubre cómo convertir energía química (glucosa) en ATP. 3️⃣ Nucleus Nexus – Aprende a equilibrar los comandos genéticos de creación. 4️⃣ Photosynthesis Fields – Usa la luz para regenerar zonas del planeta. 5️⃣ Energy Restoration – Combina todos los procesos para revivir el planeta. En cada mundo, el entorno cambia: empieza oscuro y sin vida, y termina lleno de luz, vegetación y partículas energéticas flotantes. ⸻ 🎨 Diseño visual (muy importante) • Estilo: futurista orgánico bioluminiscente, mezcla entre Ori and the Blind Forest, Journey y No Man’s Sky. • Paleta: azules eléctricos, magentas suaves, dorados y tonos negros de fondo. • La cámara debe tener efecto de profundidad y movimiento suave (parallax). • Las animaciones deben ser fluidas y tener partículas de energía flotando constantemente. • Cuando el jugador absorbe o equilibra energía, el entorno responde (raíces, luces, movimientos ondulantes). ⸻ 🔊 Audio y atmósfera • Música ambiental cambiante según el estado energético del jugador: • Equilibrio → música suave, celestial. • Energía baja → sonido oscuro, pulsante. • Energía alta → distorsión brillante. • Efectos de sonido: • “Ping” etéreo al absorber moléculas. • “Whoosh” de energía al activar organelos. • Zumbido ambiental constante (vida fluyendo). ⸻ 🧬 Interfaz y narrativa • HUD minimalista y translúcido (solo la barra ATP y un pequeño contador de moléculas recolectadas). • Pequeños textos narrativos aparecen en pantalla (como si fueran pensamientos de E.L.Y.S.) con frases tipo: • “The system must be restored.” • “Balance... energy... life.” • “The world remembers.” ⸻ 🌈 Objetivo educativo Mostrar visualmente cómo los procesos metabólicos mantienen la vida. Sin usar explicaciones aburridas, sino con sensaciones visuales: cuando el jugador logra equilibrio, el mundo renace. Es un juego que mezcla ciencia y arte: bello, fluido y con propósito. ⸻ 🌟 Final Cuando el jugador logra restaurar el balance total, se muestra una escena final del planeta renacido desde el espacio. La voz suave de E.L.Y.S. dice: “Life connects everything. Energy is the link.” Luego aparece el logo brillante del juego y la opción “Play Again”. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
haz que los iconos sean más grandes de tamaño todos incluso la célula, pero cuida que no sean mas grandes que la célula el fondo hazlo más llamativo como si estuviéramos en un espacio desconocido con cosas bastantes cool y llamativos colores padres que ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Diseña la interfaz visual de un videojuego educativo sobre metabolismo celular, con estética moderna, colorida y científica. El jugador es una célula representada como una esfera luminosa azul que se mueve en un fondo fluido y orgánico de tonos azules y violetas. A su alrededor flotan pequeñas partículas de diferentes colores que representan nutrientes: - Cuadrados amarillos = glucosa - Cuadrados naranjas = aminoácidos - Cuadrados rojos = lípidos La interfaz debe incluir: - Barra de energía (ATP) en la esquina superior izquierda, con estilo futurista y animado. - Contadores “G: A: L:” con iconos pequeños de moléculas al lado de cada número. - Botón de pausa moderno y minimalista. - Efecto de resplandor suave y movimiento flotante en las partículas. - Transiciones suaves, partículas que reaccionan al movimiento del jugador y un fondo con gradiente dinámico o animado. - Estilo general tipo videojuego científico moderno, con toques de bioluminiscencia. Sistema de partículas más claro: Las partículas (nutrientes) podrían tener un efecto de “hover” o brillar un poco cuando el jugador se acerca, así se entiende que debe recogerlas. Puedes añadir un pequeño texto flotante que diga el nombre del nutriente (“Glucose +1”) cuando lo recoja. Fondo dinámico: Usa un gradiente animado (por ejemplo, azul → violeta → celeste) para que se vea más vivo. O puedes usar una textura suave tipo “citoplasma”. Movimiento del jugador: Si se siente muy brusco, añade un poco de inercia o suavizado, como si flotara en líquido. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
E.L.Y.S. (Energy Linking Your System)
Initial prompt
Crea un videojuego 2D de aventura llamado “E.L.Y.S.” (Energy Linking Your System). El juego debe estar en idioma inglés, incluyendo todos los textos, menús, diálogos y nombres dentro del juego. Tema: Basado en la biología celular y el metabolismo (anabolismo y catabolismo). El juego combina ciencia, emoción y arte visual. Historia principal: En un futuro donde la Tierra ha perdido toda forma de vida, una pequeña célula bioluminiscente llamada E.L.Y.S. despierta en medio de un océano oscuro de energía muerta. La misión del jugador es reconstruir la vida desde cero, restaurando rutas metabólicas, creando orgánulos y reactivando la energía vital del planeta. Objetivo principal: Mantener viva a E.L.Y.S. equilibrando el anabolismo (crear moléculas) y el catabolismo (romperlas para obtener energía). Si la célula se queda sin energía (ATP), muere. Cada nivel representa una parte del metabolismo que el jugador debe “reparar” para que el mundo recupere la vida. Mecánicas de juego: Estilo 2D side-scroller con exploración y resolución de acertijos. Controles simples: mover, absorber moléculas, crear orgánulos y usar habilidades. Cada acción consume energía (ATP). Los jugadores recolectan moléculas y desbloquean orgánulos (como mitocondrias o cloroplastos) que otorgan nuevas habilidades. Hay enemigos que representan toxinas o virus que roban energía o destruyen partes celulares. A medida que el jugador restaura funciones biológicas, el mundo se llena de color, luz y música. Estilo visual: Arte tipo Inside o Ori and the Will of the Wisps. Tonos neón rosa y azul, con brillo bioluminiscente y ambiente oscuro pero hermoso. Efectos de partículas de energía, movimientos suaves y atmósfera etérea. Música ambiental suave, con sonidos de energía, respiración y pulsaciones. Niveles sugeridos: Cytoplasm Caverns — aprender a sobrevivir y recolectar energía. Mitochondrial Core — generar ATP y evitar toxinas. Nucleus Nexus — reparar ADN y comunicación celular. Photosynthesis Field — usar luz para obtener energía. Energy Abyss — restaurar todo el metabolismo y reanimar el planeta. Elementos educativos: El juego debe integrar de manera natural conceptos de biología real (función de organelos, producción de energía, equilibrio metabólico). El aprendizaje debe sentirse como parte de la aventura, no como una lección. Estilo general: Un juego poético, educativo y visualmente hermoso. Que transmita esperanza y conexión con la vida. Lenguaje del juego: completamente en inglés.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Molecule = Container.expand(function (type) {
var self = Container.call(this);
self.type = type || 'glucose';
self.value = type === 'glucose' ? 10 : type === 'aminoAcid' ? 8 : 12;
var graphics = self.attachAsset(self.type, {
anchorX: 0.5,
anchorY: 0.5
});
// Gentle floating animation
self.floatOffset = Math.random() * Math.PI * 2;
self.floatSpeed = 0.02 + Math.random() * 0.02;
self.update = function () {
graphics.y += Math.sin(LK.ticks * self.floatSpeed + self.floatOffset) * 0.5;
graphics.x += Math.cos(LK.ticks * self.floatSpeed * 0.7 + self.floatOffset) * 0.3;
// Proximity glow effect when E.L.Y.S. is near
if (elys) {
var distance = Math.sqrt(Math.pow(self.x - elys.x, 2) + Math.pow(self.y - elys.y, 2));
if (distance < 120) {
var glowIntensity = 1 - distance / 120;
graphics.alpha = 0.8 + glowIntensity * 0.5;
graphics.scaleX = graphics.scaleY = 1 + glowIntensity * 0.3;
} else {
graphics.alpha = 0.8;
graphics.scaleX = graphics.scaleY = 1;
}
}
};
return self;
});
var Organelle = Container.expand(function (type, x, y) {
var self = Container.call(this);
self.type = type;
self.energyRate = type === 'mitochondria' ? 2 : 1;
self.active = false;
var graphics = self.attachAsset(self.type, {
anchorX: 0.5,
anchorY: 0.5
});
self.x = x;
self.y = y;
graphics.alpha = 0.7;
self.activate = function () {
self.active = true;
graphics.alpha = 1.0;
tween(graphics, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 200,
easing: tween.easeOut
});
tween(graphics, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 200,
easing: tween.easeIn
});
};
self.update = function () {
if (self.active && LK.ticks % 60 === 0) {
// Generate energy periodically
currentATP = Math.min(maxATP, currentATP + self.energyRate);
}
};
return self;
});
var Toxin = Container.expand(function () {
var self = Container.call(this);
var graphics = self.attachAsset('toxin', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 1 + Math.random() * 2;
self.direction = Math.random() * Math.PI * 2;
self.damage = 15;
self.update = function () {
self.x += Math.cos(self.direction) * self.speed;
self.y += Math.sin(self.direction) * self.speed;
// Bounce off edges
if (self.x < 50 || self.x > 1998) {
self.direction = Math.PI - self.direction;
}
if (self.y < 50 || self.y > 2682) {
self.direction = -self.direction;
}
// Keep in bounds
self.x = Math.max(50, Math.min(1998, self.x));
self.y = Math.max(50, Math.min(2682, self.y));
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x001122
});
/****
* Game Code
****/
// Game state management
var gameState = 'mainMenu'; // 'mainMenu', 'intro', 'playing', 'paused'
var currentLevel = 1;
var levelNames = ['Cytoplasm Caverns', 'Mitochondrial Core', 'Nucleus Nexus', 'Photosynthesis Fields', 'Energy Restoration'];
// Main Menu Elements
var titleText = new Text2('E.L.Y.S.', {
size: 180,
fill: '#00FFFF'
});
var subtitleText = new Text2('Energy Linking Your System', {
size: 60,
fill: '#88AAFF'
});
var beginButton = LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 0.8,
tint: 0x00AA88
});
var continueButton = LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 0.8,
tint: 0xAA8800
});
var aboutButton = LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.5,
scaleY: 0.8,
tint: 0x8800AA
});
var beginText = new Text2('Begin Journey', {
size: 48,
fill: '#FFFFFF'
});
var continueText = new Text2('Continue', {
size: 48,
fill: '#FFFFFF'
});
var aboutText = new Text2('About E.L.Y.S.', {
size: 48,
fill: '#FFFFFF'
});
// Story text elements
var storyText = new Text2('', {
size: 40,
fill: '#CCCCFF'
});
// Dynamic space background variables with exciting colors
var backgroundPhase = 0;
var backgroundColors = [0x0a0040, 0x1a0080, 0x2010a0, 0x4020c0, 0x6030e0, 0x8040ff, 0xa060ff, 0xc080ff];
var starField = [];
var nebulaClouds = [];
// Game state variables
var currentATP = 50;
var maxATP = 100;
var glucoseCount = 0;
var aminoAcidCount = 0;
var lipidCount = 0;
var worldBrightness = 0.2;
var level = 1;
// Game objects
var elys;
var molecules = [];
var organelles = [];
var toxins = [];
var dragNode = null;
// UI Elements - Futuristic ATP Bar
var atpBarBackground = LK.getAsset('glucose', {
anchorX: 0,
anchorY: 0,
scaleX: 4,
scaleY: 0.4,
tint: 0x112233
});
var atpBar = LK.getAsset('glucose', {
anchorX: 0,
anchorY: 0,
scaleX: 4,
scaleY: 0.4,
tint: 0x00AAFF
});
var atpGlow = LK.getAsset('glucose', {
anchorX: 0,
anchorY: 0,
scaleX: 4,
scaleY: 0.4,
tint: 0x00FFFF,
alpha: 0.5
});
var atpText = new Text2('ATP: 50/100', {
size: 45,
fill: '#00FFFF'
});
// Modern resource display with icons
var glucoseIcon = LK.getAsset('glucose', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.9,
scaleY: 0.9
});
var aminoIcon = LK.getAsset('aminoAcid', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.9,
scaleY: 0.9
});
var lipidIcon = LK.getAsset('lipid', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.9,
scaleY: 0.9
});
var glucoseText = new Text2('0', {
size: 38,
fill: '#FFFF00'
});
var aminoText = new Text2('0', {
size: 38,
fill: '#FF8800'
});
var lipidText = new Text2('0', {
size: 38,
fill: '#FF0080'
});
var resourceText = new Text2('MOLECULES:', {
size: 32,
fill: '#AAAAAA'
});
var instructionText = new Text2('Collect molecules, build organelles!', {
size: 30,
fill: 0xFFFF88
});
// Add hint system
var hintText = new Text2('', {
size: 26,
fill: 0x88FFAA
});
hintText.anchor.set(0.5, 0);
hintText.alpha = 0;
LK.gui.bottom.addChild(hintText);
hintText.x = 1024;
hintText.y = 2550;
var hintTimer = 0;
var hints = ["Move E.L.Y.S. to collect glowing molecules", "ATP energy decreases over time - stay active!", "Build mitochondria with 3 glucose + 2 amino acids", "Avoid red toxins - they drain your energy", "Balance anabolism and catabolism to survive"];
var currentHint = 0;
// Narrative system
var narrativeTexts = ["The system must be restored...", "Balance... energy... life...", "The world remembers...", "Life connects everything.", "Energy is the link.", "Darkness cannot overcome the spark.", "Each molecule holds hope.", "The planet waits for revival."];
var currentNarrative = 0;
var narrativeTimer = 0;
var floatingNarrative = new Text2('', {
size: 36,
fill: '#AACCFF'
});
floatingNarrative.anchor.set(0.5, 0.5);
floatingNarrative.alpha = 0;
game.addChild(floatingNarrative);
// Position UI elements with modern spacing
atpBarBackground.x = 120;
atpBarBackground.y = 160;
atpBar.x = 120;
atpBar.y = 160;
atpGlow.x = 120;
atpGlow.y = 160;
atpText.anchor.set(0, 0);
atpText.x = 120;
atpText.y = 110;
// Position resource elements
resourceText.anchor.set(0, 0);
resourceText.x = 120;
resourceText.y = 220;
glucoseIcon.x = 150;
glucoseIcon.y = 270;
glucoseText.anchor.set(0, 0.5);
glucoseText.x = 180;
glucoseText.y = 270;
aminoIcon.x = 250;
aminoIcon.y = 270;
aminoText.anchor.set(0, 0.5);
aminoText.x = 280;
aminoText.y = 270;
lipidIcon.x = 350;
lipidIcon.y = 270;
lipidText.anchor.set(0, 0.5);
lipidText.x = 380;
lipidText.y = 270;
instructionText.anchor.set(0.5, 0);
instructionText.x = 1024;
instructionText.y = 2600;
// Position main menu elements
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 800;
subtitleText.anchor.set(0.5, 0.5);
subtitleText.x = 1024;
subtitleText.y = 920;
beginButton.x = 1024;
beginButton.y = 1200;
continueButton.x = 1024;
continueButton.y = 1400;
aboutButton.x = 1024;
aboutButton.y = 1600;
beginText.anchor.set(0.5, 0.5);
beginText.x = 1024;
beginText.y = 1200;
continueText.anchor.set(0.5, 0.5);
continueText.x = 1024;
continueText.y = 1400;
aboutText.anchor.set(0.5, 0.5);
aboutText.x = 1024;
aboutText.y = 1600;
storyText.anchor.set(0.5, 0.5);
storyText.x = 1024;
storyText.y = 1366;
// Add main menu elements to game
game.addChild(titleText);
game.addChild(subtitleText);
game.addChild(beginButton);
game.addChild(continueButton);
game.addChild(aboutButton);
game.addChild(beginText);
game.addChild(continueText);
game.addChild(aboutText);
game.addChild(storyText);
// Add UI to GUI
LK.gui.topLeft.addChild(atpBarBackground);
LK.gui.topLeft.addChild(atpBar);
LK.gui.topLeft.addChild(atpGlow);
LK.gui.topLeft.addChild(atpText);
LK.gui.topLeft.addChild(resourceText);
LK.gui.topLeft.addChild(glucoseIcon);
LK.gui.topLeft.addChild(glucoseText);
LK.gui.topLeft.addChild(aminoIcon);
LK.gui.topLeft.addChild(aminoText);
LK.gui.topLeft.addChild(lipidIcon);
LK.gui.topLeft.addChild(lipidText);
LK.gui.bottom.addChild(instructionText);
// Create stunning space background with stars
for (var i = 0; i < 150; i++) {
var star = game.addChild(LK.getAsset('glucose', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.1 + Math.random() * 0.3,
scaleY: 0.1 + Math.random() * 0.3,
tint: Math.random() > 0.7 ? 0xffffff : Math.random() > 0.4 ? 0x88ccff : 0xffccaa,
alpha: 0.3 + Math.random() * 0.7
}));
star.x = Math.random() * 2048;
star.y = Math.random() * 2732;
star.twinkleSpeed = 0.01 + Math.random() * 0.03;
star.twinkleOffset = Math.random() * Math.PI * 2;
starField.push(star);
}
// Create nebula cloud effects
for (var i = 0; i < 8; i++) {
var cloud = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3 + Math.random() * 4,
scaleY: 2 + Math.random() * 3,
tint: [0xff00ff, 0x00ffff, 0xff8800, 0x8800ff, 0x00ff88][Math.floor(Math.random() * 5)],
alpha: 0.1 + Math.random() * 0.2
}));
cloud.x = Math.random() * 2048;
cloud.y = Math.random() * 2732;
cloud.driftSpeed = 0.2 + Math.random() * 0.5;
cloud.driftDirection = Math.random() * Math.PI * 2;
nebulaClouds.push(cloud);
}
// Create E.L.Y.S.
elys = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5
}));
elys.x = 1024;
elys.y = 1366;
// Add smooth movement physics
elys.targetX = elys.x;
elys.targetY = elys.y;
elys.velocity = {
x: 0,
y: 0
};
// Create bioluminescent glow effect with enhanced styling
var elysglow = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2.0,
scaleY: 2.0,
alpha: 0.4,
tint: 0x00FFFF
}));
elysglow.x = elys.x;
elysglow.y = elys.y;
// Create secondary outer glow for depth
var elysOuterGlow = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3.0,
scaleY: 3.0,
alpha: 0.15,
tint: 0xFF00FF
}));
elysOuterGlow.x = elys.x;
elysOuterGlow.y = elys.y;
// Add pulsating energy core
var elysPulse = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.8,
scaleY: 0.8,
alpha: 0.8,
tint: 0xFFFFFF
}));
elysPulse.x = elys.x;
elysPulse.y = elys.y;
// Initialize molecules
function spawnMolecule() {
var types = ['glucose', 'aminoAcid', 'lipid'];
var type = types[Math.floor(Math.random() * types.length)];
var molecule = game.addChild(new Molecule(type));
molecule.x = 100 + Math.random() * 1848;
molecule.y = 100 + Math.random() * 2532;
molecules.push(molecule);
}
// Initialize toxins
function spawnToxin() {
var toxin = game.addChild(new Toxin());
toxin.x = Math.random() * 2048;
toxin.y = Math.random() * 2732;
toxins.push(toxin);
}
// Initialize in main menu state
showMainMenu();
// Add floating animations to menu buttons
tween(beginButton, {
y: beginButton.y + 10
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(beginButton, {
y: beginButton.y - 10
}, {
duration: 2000,
easing: tween.easeInOut
});
}
});
tween(continueButton, {
y: continueButton.y - 8
}, {
duration: 2200,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(continueButton, {
y: continueButton.y + 8
}, {
duration: 2200,
easing: tween.easeInOut
});
}
});
tween(aboutButton, {
y: aboutButton.y + 12
}, {
duration: 1800,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(aboutButton, {
y: aboutButton.y - 12
}, {
duration: 1800,
easing: tween.easeInOut
});
}
});
// Spawn initial molecules and toxins (only when playing)
// for (var i = 0; i < 15; i++) {
// spawnMolecule();
// }
// for (var i = 0; i < 3; i++) {
// spawnToxin();
// }
// Game state management functions
function showMainMenu() {
titleText.alpha = 1;
subtitleText.alpha = 1;
beginButton.alpha = 1;
continueButton.alpha = 1;
aboutButton.alpha = 1;
beginText.alpha = 1;
continueText.alpha = 1;
aboutText.alpha = 1;
storyText.alpha = 0;
// Hide game UI
atpBarBackground.alpha = 0;
atpBar.alpha = 0;
atpGlow.alpha = 0;
atpText.alpha = 0;
resourceText.alpha = 0;
glucoseIcon.alpha = 0;
glucoseText.alpha = 0;
aminoIcon.alpha = 0;
aminoText.alpha = 0;
lipidIcon.alpha = 0;
lipidText.alpha = 0;
instructionText.alpha = 0;
// Hide E.L.Y.S.
if (elys) elys.alpha = 0;
if (elysglow) elysglow.alpha = 0;
}
function hideMainMenu() {
titleText.alpha = 0;
subtitleText.alpha = 0;
beginButton.alpha = 0;
continueButton.alpha = 0;
aboutButton.alpha = 0;
beginText.alpha = 0;
continueText.alpha = 0;
aboutText.alpha = 0;
// Show game UI
atpBarBackground.alpha = 1;
atpBar.alpha = 1;
atpGlow.alpha = 0.5;
atpText.alpha = 1;
resourceText.alpha = 1;
glucoseIcon.alpha = 1;
glucoseText.alpha = 1;
aminoIcon.alpha = 1;
aminoText.alpha = 1;
lipidIcon.alpha = 1;
lipidText.alpha = 1;
instructionText.alpha = 1;
// Show E.L.Y.S.
if (elys) elys.alpha = 1;
if (elysglow) elysglow.alpha = 0.3;
}
function showIntroSequence() {
gameState = 'intro';
hideMainMenu();
// Create cinematic spark effect
var spark = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.1,
scaleY: 0.1,
alpha: 0,
tint: 0xFFFFFF
}));
spark.x = 1024;
spark.y = 200;
// Animate spark falling
tween(spark, {
y: 1366,
alpha: 1,
scaleX: 0.5,
scaleY: 0.5
}, {
duration: 2000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Spark impact effect
LK.effects.flashScreen(0x00FFFF, 800);
tween(spark, {
scaleX: 2.0,
scaleY: 2.0,
alpha: 0
}, {
duration: 1000,
onFinish: function onFinish() {
spark.destroy();
}
});
}
});
storyText.alpha = 1;
storyText.setText('In an ancient and silent planet,\na single spark of life called E.L.Y.S. awakens\nin the midst of darkness...');
storyText.tint = 0x88CCFF;
// Animate intro text with glow effect
tween(storyText, {
alpha: 1,
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 2000,
easing: tween.easeOut,
onFinish: function onFinish() {
LK.setTimeout(function () {
tween(storyText, {
alpha: 0,
y: storyText.y - 100
}, {
duration: 1000,
easing: tween.easeIn,
onFinish: function onFinish() {
startGame();
}
});
}, 3000);
}
});
}
function startGame() {
gameState = 'playing';
storyText.alpha = 0;
hideMainMenu();
// Start background music
LK.playMusic('song', {
fade: {
start: 0,
end: 0.6,
duration: 2000
}
});
}
// Helper functions
function updateUI() {
var atpPercent = currentATP / maxATP;
// Smooth ATP bar animation
tween(atpBar, {
scaleX: 4 * atpPercent
}, {
duration: 200,
easing: tween.easeOut
});
tween(atpGlow, {
scaleX: 4 * atpPercent
}, {
duration: 300,
easing: tween.easeOut
});
// Dynamic color transitions
if (atpPercent > 0.6) {
tween(atpBar, {
tint: 0x00AAFF
}, {
duration: 300
});
tween(atpGlow, {
tint: 0x00FFFF
}, {
duration: 300
});
} else if (atpPercent > 0.3) {
tween(atpBar, {
tint: 0xFFAA00
}, {
duration: 300
});
tween(atpGlow, {
tint: 0xFFFF00
}, {
duration: 300
});
} else {
tween(atpBar, {
tint: 0xFF3300
}, {
duration: 300
});
tween(atpGlow, {
tint: 0xFF0000
}, {
duration: 300
});
}
// Pulsing glow effect
atpGlow.alpha = 0.3 + Math.sin(LK.ticks * 0.1) * 0.2;
atpText.setText('ENERGY: ' + Math.floor(currentATP) + '/' + maxATP);
glucoseText.setText(glucoseCount);
aminoText.setText(aminoAcidCount);
lipidText.setText(lipidCount);
// Update E.L.Y.S. glow based on energy with enhanced effects
var targetAlpha = 0.6 + atpPercent * 0.4;
var targetScale = 0.9 + atpPercent * 0.3;
var energyTint = atpPercent > 0.6 ? 0x00FFFF : atpPercent > 0.3 ? 0xFFFF00 : 0xFF3300;
tween(elys, {
alpha: targetAlpha,
tint: energyTint
}, {
duration: 300
});
tween(elysglow, {
scaleX: 1.8 + targetScale,
scaleY: 1.8 + targetScale,
alpha: 0.3 + atpPercent * 0.2,
tint: energyTint
}, {
duration: 500
});
// Update outer glow
tween(elysOuterGlow, {
scaleX: 2.5 + targetScale,
scaleY: 2.5 + targetScale,
alpha: 0.1 + atpPercent * 0.1
}, {
duration: 800
});
// Pulsating core effect
var pulseIntensity = 0.6 + Math.sin(LK.ticks * 0.08) * 0.2;
tween(elysPulse, {
alpha: pulseIntensity,
scaleX: 0.7 + pulseIntensity * 0.2,
scaleY: 0.7 + pulseIntensity * 0.2
}, {
duration: 200
});
// Dynamic space background with exciting effects
backgroundPhase += 0.015;
var colorIndex = Math.floor(backgroundPhase) % backgroundColors.length;
var nextColorIndex = (colorIndex + 1) % backgroundColors.length;
var lerpFactor = backgroundPhase - Math.floor(backgroundPhase);
var currentBg = backgroundColors[colorIndex];
game.setBackgroundColor(currentBg);
// Animate twinkling stars
for (var i = 0; i < starField.length; i++) {
var star = starField[i];
star.alpha = 0.3 + Math.sin(LK.ticks * star.twinkleSpeed + star.twinkleOffset) * 0.4 + Math.random() * 0.2;
// Some stars slowly drift
if (i % 5 === 0) {
star.x += Math.sin(LK.ticks * 0.001 + i) * 0.1;
star.y += Math.cos(LK.ticks * 0.0008 + i) * 0.1;
}
}
// Animate nebula clouds with gentle drift and color shifts
for (var i = 0; i < nebulaClouds.length; i++) {
var cloud = nebulaClouds[i];
cloud.x += Math.cos(cloud.driftDirection) * cloud.driftSpeed;
cloud.y += Math.sin(cloud.driftDirection) * cloud.driftSpeed;
// Wrap around screen edges
if (cloud.x > 2100) cloud.x = -100;
if (cloud.x < -100) cloud.x = 2100;
if (cloud.y > 2800) cloud.y = -100;
if (cloud.y < -100) cloud.y = 2800;
// Subtle alpha pulsing for mystical effect
cloud.alpha = 0.1 + Math.sin(LK.ticks * 0.008 + i) * 0.1;
// Occasional color shifts for dynamic feel
if (LK.ticks % 600 === i * 20) {
var newColors = [0xff00ff, 0x00ffff, 0xff8800, 0x8800ff, 0x00ff88, 0xff4080, 0x4080ff];
tween(cloud, {
tint: newColors[Math.floor(Math.random() * newColors.length)]
}, {
duration: 2000,
easing: tween.easeInOut
});
}
}
// Update narrative system
if (gameState === 'playing') {
narrativeTimer++;
if (narrativeTimer > 1200) {
// Show narrative every 20 seconds
narrativeTimer = 0;
floatingNarrative.setText(narrativeTexts[currentNarrative]);
floatingNarrative.x = 1024 + (Math.random() - 0.5) * 400;
floatingNarrative.y = 1366 + (Math.random() - 0.5) * 300;
// Animate floating narrative
tween(floatingNarrative, {
alpha: 0.8
}, {
duration: 500,
onFinish: function onFinish() {
LK.setTimeout(function () {
tween(floatingNarrative, {
alpha: 0,
y: floatingNarrative.y - 50
}, {
duration: 1000
});
}, 2000);
}
});
currentNarrative = (currentNarrative + 1) % narrativeTexts.length;
}
// Update world transformation based on progress
var progress = organelles.length / 5;
worldBrightness = 0.2 + progress * 0.8;
// Transform environment colors as progress increases
if (progress > 0.8) {
// Final transformation - vibrant life
game.setBackgroundColor(0x002244);
for (var i = 0; i < starField.length; i++) {
starField[i].tint = 0xffff88;
starField[i].alpha = 0.8 + Math.sin(LK.ticks * 0.05 + i) * 0.2;
}
} else if (progress > 0.6) {
// Growing life
game.setBackgroundColor(0x001833);
} else if (progress > 0.4) {
// First signs of life
game.setBackgroundColor(0x001122);
}
// Update level display with glow effect
instructionText.setText('Level ' + currentLevel + ': ' + levelNames[currentLevel - 1]);
instructionText.tint = 0xFFFF88 + Math.floor(Math.sin(LK.ticks * 0.05) * 0x003300);
// Update hint system
if (gameState === 'playing') {
hintTimer++;
if (hintTimer > 900 && hintText.alpha === 0) {
// Show hint every 15 seconds
hintText.setText(hints[currentHint]);
tween(hintText, {
alpha: 0.8
}, {
duration: 500,
onFinish: function onFinish() {
LK.setTimeout(function () {
tween(hintText, {
alpha: 0
}, {
duration: 500
});
}, 3000);
}
});
currentHint = (currentHint + 1) % hints.length;
hintTimer = 0;
}
}
}
}
function buildOrganelle(type) {
var cost = type === 'mitochondria' ? {
glucose: 3,
aminoAcid: 2
} : {
glucose: 2,
lipid: 2
};
if ((cost.glucose || 0) <= glucoseCount && (cost.aminoAcid || 0) <= aminoAcidCount && (cost.lipid || 0) <= lipidCount) {
glucoseCount -= cost.glucose || 0;
aminoAcidCount -= cost.aminoAcid || 0;
lipidCount -= cost.lipid || 0;
var organelle = game.addChild(new Organelle(type, elys.x + (Math.random() - 0.5) * 200, elys.y + (Math.random() - 0.5) * 200));
organelles.push(organelle);
organelle.activate();
worldBrightness = Math.min(1.0, worldBrightness + 0.1);
LK.getSound('build').play();
LK.effects.flashObject(organelle, 0x00ffff, 500);
return true;
}
return false;
}
// Event handlers
function handleMove(x, y, obj) {
if (dragNode) {
// Smooth movement with physics
dragNode.targetX = x;
dragNode.targetY = y;
// Add momentum and fluid movement
var dx = dragNode.targetX - dragNode.x;
var dy = dragNode.targetY - dragNode.y;
dragNode.velocity.x += dx * 0.1;
dragNode.velocity.y += dy * 0.1;
dragNode.velocity.x *= 0.85;
dragNode.velocity.y *= 0.85;
dragNode.x += dragNode.velocity.x;
dragNode.y += dragNode.velocity.y;
// Update all glow effects positions smoothly
tween(elysglow, {
x: dragNode.x,
y: dragNode.y
}, {
duration: 100,
easing: tween.easeOut
});
tween(elysOuterGlow, {
x: dragNode.x,
y: dragNode.y
}, {
duration: 150,
easing: tween.easeOut
});
tween(elysPulse, {
x: dragNode.x,
y: dragNode.y
}, {
duration: 80,
easing: tween.easeOut
});
// Moving costs energy with visual feedback
if (LK.ticks % 10 === 0) {
currentATP = Math.max(0, currentATP - 0.5);
// Create trailing particle effect when moving fast
var speed = Math.sqrt(dragNode.velocity.x * dragNode.velocity.x + dragNode.velocity.y * dragNode.velocity.y);
if (speed > 2) {
elysglow.alpha = 0.5 + speed * 0.1;
}
}
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
if (gameState === 'mainMenu') {
// Check button clicks
var gamePos = game.toLocal({
x: x,
y: y
});
// Begin Journey button
if (Math.abs(gamePos.x - beginButton.x) < 120 && Math.abs(gamePos.y - beginButton.y) < 40) {
LK.getSound('menuClick').play();
tween(beginButton, {
scaleX: 1.3,
scaleY: 0.6,
tint: 0x00FFFF
}, {
duration: 100,
onFinish: function onFinish() {
tween(beginButton, {
scaleX: 1.5,
scaleY: 0.8,
tint: 0x00AA88
}, {
duration: 100
});
}
});
// Add fade transition
tween(game, {
alpha: 0
}, {
duration: 500,
onFinish: function onFinish() {
showIntroSequence();
tween(game, {
alpha: 1
}, {
duration: 500
});
}
});
return;
}
// Continue button
if (Math.abs(gamePos.x - continueButton.x) < 120 && Math.abs(gamePos.y - continueButton.y) < 40) {
tween(continueButton, {
scaleX: 1.3,
scaleY: 0.6
}, {
duration: 100,
onFinish: function onFinish() {
tween(continueButton, {
scaleX: 1.5,
scaleY: 0.8
}, {
duration: 100
});
}
});
startGame();
return;
}
// About button
if (Math.abs(gamePos.x - aboutButton.x) < 120 && Math.abs(gamePos.y - aboutButton.y) < 40) {
tween(aboutButton, {
scaleX: 1.3,
scaleY: 0.6
}, {
duration: 100,
onFinish: function onFinish() {
tween(aboutButton, {
scaleX: 1.5,
scaleY: 0.8
}, {
duration: 100
});
}
});
storyText.alpha = 1;
storyText.setText('Guide E.L.Y.S. through a dead world.\nBalance energy creation and consumption.\nRestore metabolic pathways to bring life back to Earth.\n\nTap to return to menu.');
return;
}
// Hide about text
if (storyText.alpha > 0) {
storyText.alpha = 0;
}
} else if (gameState === 'playing') {
dragNode = elys;
handleMove(x, y, obj);
// Try building organelles on double tap
if (glucoseCount >= 3 && aminoAcidCount >= 2) {
buildOrganelle('mitochondria');
} else if (glucoseCount >= 2 && lipidCount >= 2) {
buildOrganelle('chloroplast');
}
}
};
game.up = function (x, y, obj) {
dragNode = null;
};
// Main game loop
game.update = function () {
// Update UI
updateUI();
// Only run game logic when playing
if (gameState !== 'playing') {
return;
}
// Initialize molecules and toxins when starting to play
if (molecules.length === 0 && toxins.length === 0) {
for (var i = 0; i < 15; i++) {
spawnMolecule();
}
for (var i = 0; i < 3; i++) {
spawnToxin();
}
}
// Check for game over
if (currentATP <= 0) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
// ATP decay over time
if (LK.ticks % 120 === 0) {
currentATP = Math.max(0, currentATP - 1);
}
// Check molecule collection
for (var i = molecules.length - 1; i >= 0; i--) {
var molecule = molecules[i];
if (elys.intersects(molecule)) {
// Create floating text feedback
var collectText = new Text2('', {
size: 28,
fill: '#FFFFFF'
});
collectText.anchor.set(0.5, 0.5);
collectText.x = molecule.x;
collectText.y = molecule.y;
game.addChild(collectText);
// Collect molecule with specific feedback
if (molecule.type === 'glucose') {
glucoseCount++;
collectText.setText('Glucose +' + molecule.value);
collectText.fill = '#FFFF00';
tween(glucoseIcon, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 150,
onFinish: function onFinish() {
tween(glucoseIcon, {
scaleX: 0.9,
scaleY: 0.9
}, {
duration: 150
});
}
});
} else if (molecule.type === 'aminoAcid') {
aminoAcidCount++;
collectText.setText('Amino Acid +' + molecule.value);
collectText.fill = '#FF8800';
tween(aminoIcon, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 150,
onFinish: function onFinish() {
tween(aminoIcon, {
scaleX: 0.9,
scaleY: 0.9
}, {
duration: 150
});
}
});
} else if (molecule.type === 'lipid') {
lipidCount++;
collectText.setText('Lipid +' + molecule.value);
collectText.fill = '#FF0080';
tween(lipidIcon, {
scaleX: 1.1,
scaleY: 1.1
}, {
duration: 150,
onFinish: function onFinish() {
tween(lipidIcon, {
scaleX: 0.9,
scaleY: 0.9
}, {
duration: 150
});
}
});
}
// Animate floating text
tween(collectText, {
y: collectText.y - 80,
alpha: 0
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
collectText.destroy();
}
});
currentATP = Math.min(maxATP, currentATP + molecule.value);
LK.getSound('collect').play();
LK.effects.flashObject(elys, 0x00ff00, 300);
// Enhance collection effect
tween(elys, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 150,
onFinish: function onFinish() {
tween(elys, {
scaleX: 1.0,
scaleY: 1.0
}, {
duration: 150
});
}
});
molecule.destroy();
molecules.splice(i, 1);
}
}
// Check toxin collision
for (var i = toxins.length - 1; i >= 0; i--) {
var toxin = toxins[i];
if (elys.intersects(toxin)) {
currentATP = Math.max(0, currentATP - toxin.damage);
LK.getSound('damage').play();
LK.effects.flashObject(elys, 0xff0000, 500);
LK.effects.flashScreen(0xff0000, 200);
// Remove toxin after hit
toxin.destroy();
toxins.splice(i, 1);
}
}
// Spawn new molecules periodically
if (LK.ticks % 300 === 0 && molecules.length < 20) {
spawnMolecule();
}
// Spawn new toxins occasionally
if (LK.ticks % 600 === 0 && toxins.length < 5) {
spawnToxin();
}
// Check win condition with epic ending
if (organelles.length >= 5 && worldBrightness >= 0.8) {
// Epic planetary restoration effect
for (var i = 0; i < starField.length; i++) {
tween(starField[i], {
tint: 0xFFFF88,
alpha: 1.0,
scaleX: starField[i].scaleX * 2,
scaleY: starField[i].scaleY * 2
}, {
duration: 3000,
easing: tween.easeOut
});
}
// Transform nebula to living colors
for (var i = 0; i < nebulaClouds.length; i++) {
tween(nebulaClouds[i], {
tint: 0x00FF88,
alpha: 0.6,
scaleX: nebulaClouds[i].scaleX * 1.5,
scaleY: nebulaClouds[i].scaleY * 1.5
}, {
duration: 4000,
easing: tween.easeOut
});
}
// Show final transformation
floatingNarrative.setText('Life connects everything.\nEnergy is the link.');
floatingNarrative.x = 1024;
floatingNarrative.y = 1366;
floatingNarrative.tint = 0x00FFAA;
tween(floatingNarrative, {
alpha: 1,
scaleX: 2.0,
scaleY: 2.0
}, {
duration: 3000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Create energy pulse from center
LK.effects.flashScreen(0x00FFFF, 1000);
LK.setTimeout(function () {
LK.effects.flashScreen(0x00ff88, 2000);
// Play victory sound
LK.getSound('energyPulse').play();
LK.showYouWin();
}, 1500);
}
});
}
// Update score based on organelles built
LK.setScore(organelles.length * 100 + Math.floor(worldBrightness * 500));
}; ===================================================================
--- original.js
+++ change.js
@@ -244,8 +244,21 @@
var instructionText = new Text2('Collect molecules, build organelles!', {
size: 30,
fill: 0xFFFF88
});
+// Add hint system
+var hintText = new Text2('', {
+ size: 26,
+ fill: 0x88FFAA
+});
+hintText.anchor.set(0.5, 0);
+hintText.alpha = 0;
+LK.gui.bottom.addChild(hintText);
+hintText.x = 1024;
+hintText.y = 2550;
+var hintTimer = 0;
+var hints = ["Move E.L.Y.S. to collect glowing molecules", "ATP energy decreases over time - stay active!", "Build mitochondria with 3 glucose + 2 amino acids", "Avoid red toxins - they drain your energy", "Balance anabolism and catabolism to survive"];
+var currentHint = 0;
// Narrative system
var narrativeTexts = ["The system must be restored...", "Balance... energy... life...", "The world remembers...", "Life connects everything.", "Energy is the link.", "Darkness cannot overcome the spark.", "Each molecule holds hope.", "The planet waits for revival."];
var currentNarrative = 0;
var narrativeTimer = 0;
@@ -381,18 +394,41 @@
elys.velocity = {
x: 0,
y: 0
};
-// Create bioluminescent glow effect
+// Create bioluminescent glow effect with enhanced styling
var elysglow = game.addChild(LK.getAsset('elys', {
anchorX: 0.5,
anchorY: 0.5,
- scaleX: 1.5,
- scaleY: 1.5,
- alpha: 0.3
+ scaleX: 2.0,
+ scaleY: 2.0,
+ alpha: 0.4,
+ tint: 0x00FFFF
}));
elysglow.x = elys.x;
elysglow.y = elys.y;
+// Create secondary outer glow for depth
+var elysOuterGlow = game.addChild(LK.getAsset('elys', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 3.0,
+ scaleY: 3.0,
+ alpha: 0.15,
+ tint: 0xFF00FF
+}));
+elysOuterGlow.x = elys.x;
+elysOuterGlow.y = elys.y;
+// Add pulsating energy core
+var elysPulse = game.addChild(LK.getAsset('elys', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.8,
+ scaleY: 0.8,
+ alpha: 0.8,
+ tint: 0xFFFFFF
+}));
+elysPulse.x = elys.x;
+elysPulse.y = elys.y;
// Initialize molecules
function spawnMolecule() {
var types = ['glucose', 'aminoAcid', 'lipid'];
var type = types[Math.floor(Math.random() * types.length)];
@@ -516,21 +552,62 @@
}
function showIntroSequence() {
gameState = 'intro';
hideMainMenu();
+ // Create cinematic spark effect
+ var spark = game.addChild(LK.getAsset('elys', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.1,
+ scaleY: 0.1,
+ alpha: 0,
+ tint: 0xFFFFFF
+ }));
+ spark.x = 1024;
+ spark.y = 200;
+ // Animate spark falling
+ tween(spark, {
+ y: 1366,
+ alpha: 1,
+ scaleX: 0.5,
+ scaleY: 0.5
+ }, {
+ duration: 2000,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ // Spark impact effect
+ LK.effects.flashScreen(0x00FFFF, 800);
+ tween(spark, {
+ scaleX: 2.0,
+ scaleY: 2.0,
+ alpha: 0
+ }, {
+ duration: 1000,
+ onFinish: function onFinish() {
+ spark.destroy();
+ }
+ });
+ }
+ });
storyText.alpha = 1;
storyText.setText('In an ancient and silent planet,\na single spark of life called E.L.Y.S. awakens\nin the midst of darkness...');
- // Animate intro text
+ storyText.tint = 0x88CCFF;
+ // Animate intro text with glow effect
tween(storyText, {
- alpha: 1
+ alpha: 1,
+ scaleX: 1.1,
+ scaleY: 1.1
}, {
duration: 2000,
+ easing: tween.easeOut,
onFinish: function onFinish() {
LK.setTimeout(function () {
tween(storyText, {
- alpha: 0
+ alpha: 0,
+ y: storyText.y - 100
}, {
duration: 1000,
+ easing: tween.easeIn,
onFinish: function onFinish() {
startGame();
}
});
@@ -607,22 +684,43 @@
atpText.setText('ENERGY: ' + Math.floor(currentATP) + '/' + maxATP);
glucoseText.setText(glucoseCount);
aminoText.setText(aminoAcidCount);
lipidText.setText(lipidCount);
- // Update E.L.Y.S. glow based on energy with smooth scaling
+ // Update E.L.Y.S. glow based on energy with enhanced effects
var targetAlpha = 0.6 + atpPercent * 0.4;
var targetScale = 0.9 + atpPercent * 0.3;
+ var energyTint = atpPercent > 0.6 ? 0x00FFFF : atpPercent > 0.3 ? 0xFFFF00 : 0xFF3300;
tween(elys, {
- alpha: targetAlpha
+ alpha: targetAlpha,
+ tint: energyTint
}, {
duration: 300
});
tween(elysglow, {
- scaleX: 1.3 + targetScale,
- scaleY: 1.3 + targetScale
+ scaleX: 1.8 + targetScale,
+ scaleY: 1.8 + targetScale,
+ alpha: 0.3 + atpPercent * 0.2,
+ tint: energyTint
}, {
duration: 500
});
+ // Update outer glow
+ tween(elysOuterGlow, {
+ scaleX: 2.5 + targetScale,
+ scaleY: 2.5 + targetScale,
+ alpha: 0.1 + atpPercent * 0.1
+ }, {
+ duration: 800
+ });
+ // Pulsating core effect
+ var pulseIntensity = 0.6 + Math.sin(LK.ticks * 0.08) * 0.2;
+ tween(elysPulse, {
+ alpha: pulseIntensity,
+ scaleX: 0.7 + pulseIntensity * 0.2,
+ scaleY: 0.7 + pulseIntensity * 0.2
+ }, {
+ duration: 200
+ });
// Dynamic space background with exciting effects
backgroundPhase += 0.015;
var colorIndex = Math.floor(backgroundPhase) % backgroundColors.length;
var nextColorIndex = (colorIndex + 1) % backgroundColors.length;
@@ -706,10 +804,35 @@
} else if (progress > 0.4) {
// First signs of life
game.setBackgroundColor(0x001122);
}
- // Update level display
+ // Update level display with glow effect
instructionText.setText('Level ' + currentLevel + ': ' + levelNames[currentLevel - 1]);
+ instructionText.tint = 0xFFFF88 + Math.floor(Math.sin(LK.ticks * 0.05) * 0x003300);
+ // Update hint system
+ if (gameState === 'playing') {
+ hintTimer++;
+ if (hintTimer > 900 && hintText.alpha === 0) {
+ // Show hint every 15 seconds
+ hintText.setText(hints[currentHint]);
+ tween(hintText, {
+ alpha: 0.8
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ LK.setTimeout(function () {
+ tween(hintText, {
+ alpha: 0
+ }, {
+ duration: 500
+ });
+ }, 3000);
+ }
+ });
+ currentHint = (currentHint + 1) % hints.length;
+ hintTimer = 0;
+ }
+ }
}
}
function buildOrganelle(type) {
var cost = type === 'mitochondria' ? {
@@ -747,11 +870,30 @@
dragNode.velocity.x *= 0.85;
dragNode.velocity.y *= 0.85;
dragNode.x += dragNode.velocity.x;
dragNode.y += dragNode.velocity.y;
- // Update glow position
- elysglow.x = dragNode.x;
- elysglow.y = dragNode.y;
+ // Update all glow effects positions smoothly
+ tween(elysglow, {
+ x: dragNode.x,
+ y: dragNode.y
+ }, {
+ duration: 100,
+ easing: tween.easeOut
+ });
+ tween(elysOuterGlow, {
+ x: dragNode.x,
+ y: dragNode.y
+ }, {
+ duration: 150,
+ easing: tween.easeOut
+ });
+ tween(elysPulse, {
+ x: dragNode.x,
+ y: dragNode.y
+ }, {
+ duration: 80,
+ easing: tween.easeOut
+ });
// Moving costs energy with visual feedback
if (LK.ticks % 10 === 0) {
currentATP = Math.max(0, currentATP - 0.5);
// Create trailing particle effect when moving fast
@@ -771,23 +913,39 @@
y: y
});
// Begin Journey button
if (Math.abs(gamePos.x - beginButton.x) < 120 && Math.abs(gamePos.y - beginButton.y) < 40) {
+ LK.getSound('menuClick').play();
tween(beginButton, {
scaleX: 1.3,
- scaleY: 0.6
+ scaleY: 0.6,
+ tint: 0x00FFFF
}, {
duration: 100,
onFinish: function onFinish() {
tween(beginButton, {
scaleX: 1.5,
- scaleY: 0.8
+ scaleY: 0.8,
+ tint: 0x00AA88
}, {
duration: 100
});
}
});
- showIntroSequence();
+ // Add fade transition
+ tween(game, {
+ alpha: 0
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ showIntroSequence();
+ tween(game, {
+ alpha: 1
+ }, {
+ duration: 500
+ });
+ }
+ });
return;
}
// Continue button
if (Math.abs(gamePos.x - continueButton.x) < 120 && Math.abs(gamePos.y - continueButton.y) < 40) {
@@ -997,23 +1155,53 @@
spawnToxin();
}
// Check win condition with epic ending
if (organelles.length >= 5 && worldBrightness >= 0.8) {
+ // Epic planetary restoration effect
+ for (var i = 0; i < starField.length; i++) {
+ tween(starField[i], {
+ tint: 0xFFFF88,
+ alpha: 1.0,
+ scaleX: starField[i].scaleX * 2,
+ scaleY: starField[i].scaleY * 2
+ }, {
+ duration: 3000,
+ easing: tween.easeOut
+ });
+ }
+ // Transform nebula to living colors
+ for (var i = 0; i < nebulaClouds.length; i++) {
+ tween(nebulaClouds[i], {
+ tint: 0x00FF88,
+ alpha: 0.6,
+ scaleX: nebulaClouds[i].scaleX * 1.5,
+ scaleY: nebulaClouds[i].scaleY * 1.5
+ }, {
+ duration: 4000,
+ easing: tween.easeOut
+ });
+ }
// Show final transformation
floatingNarrative.setText('Life connects everything.\nEnergy is the link.');
floatingNarrative.x = 1024;
floatingNarrative.y = 1366;
+ floatingNarrative.tint = 0x00FFAA;
tween(floatingNarrative, {
alpha: 1,
- scaleX: 1.5,
- scaleY: 1.5
+ scaleX: 2.0,
+ scaleY: 2.0
}, {
- duration: 2000,
+ duration: 3000,
+ easing: tween.easeOut,
onFinish: function onFinish() {
+ // Create energy pulse from center
+ LK.effects.flashScreen(0x00FFFF, 1000);
LK.setTimeout(function () {
LK.effects.flashScreen(0x00ff88, 2000);
+ // Play victory sound
+ LK.getSound('energyPulse').play();
LK.showYouWin();
- }, 1000);
+ }, 1500);
}
});
}
// Update score based on organelles built