Energy - Brain Puzzle Game

Seele01-Flash
By
Energy is a captivating puzzle game that challenges your logical thinking through line connection mechanics. Connect circuits to light up lamps while enjoying a minimalist design and relaxing soundtrack that helps reduce stress.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Energy / Infinity Loop". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** 2.5D Minimalist Zen. Use an **Orthographic Camera** to maintain a flat puzzle aesthetic while allowing 3D rotation animations. * **Background:** Create a full-screen Quad with a Fragment Shader that generates a soothing, slow-moving vertical gradient (Deep Purple `#4a1c40` to Sunset Orange `#d47a50`). Add subtle, floating semi-transparent particles (bokeh effect) in the background to add depth. * **Game Pieces (The Grid):** * **Nodes:** Use simple geometric shapes (Torus segments, Cylinders for straight lines, Spheres for endpoints). * **Material:** Use `MeshBasicMaterial`. By default, disconnected lines are a dim, semi-transparent grey (`opacity: 0.3`). Connected/Powered lines are bright white (`#FFFFFF`). * **Post-Processing (Crucial):** Implement `EffectComposer` with `UnrealBloomPass`. The core visual mechanic is that "powered" lines glow intensely. The bloom threshold should be set so only the bright white lines emit a soft, ethereal halo. * **UI Overlay:** Minimalist white icons (Lightbulb for hints, Refresh for restart) positioned at the top corners. ### 2. Audio Requirements * **Background Music (BGM):** Procedural or looped ambient soundscape. Think "Ethereal Drone" or "Soft Pads" with no distinct beat, creating a meditative state. * **Sound Effects (SFX):** * **Rotation:** A soft, high-pitched "wood block" or "water drop" click sound. * **Connection:** A subtle electric hum or "fizz" sound when a line connects to power. * **Level Complete:** A harmonious major chord swell (Synth pad or Harp). ### 3. Gameplay Loop * **Grid Logic:** The game board is an `N x M` grid. Each tile contains a piece (Straight, Curve, T-shape, Cross, Power Source, Lamp). * **State Management:** * **Power Source:** Always "On". * **Propagation:** Use a recursive "flood fill" algorithm. Every time a piece rotates, recalculate the flow of electricity starting from the Power Source. If a piece's connector aligns with a powered neighbor, it turns "On" (White + Glow). * **Interaction:** Clicking a piece rotates it 90 degrees clockwise. * **Win Condition:** All "Lamp" nodes on the grid must be receiving power. * **Level Generation:** Start with a 3x3 grid (easy). Generate a valid path first, then randomize the rotations of all pieces to create the puzzle state. ### 4. Mobile Controls & Interaction * **Touch Controls:** Use `Raycaster` for precision touch detection. The touch area for each grid cell should be slightly larger than the visible mesh to ensure forgiving inputs on smaller screens. * **Orientation:** Force **Portrait Mode** layout logic (camera zoom adjusts based on screen width). * **Animation:** Do NOT snap pieces instantly. Use a tweening library (like GSAP or TWEEN.js) to smoothly animate the 90-degree rotation over 0.2s. This smoothness is key to the "relaxing" feel. * **Haptic Feedback:** Trigger `navigator.vibrate(5)` (very short/light tick) on every successful tap to mimic the tactile feel of flipping a switch. * **Visual Feedback:** When a level is completed, the entire circuit should pulse brighter once before transitioning to the next level. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Energy

Energy is an innovative brain puzzle game that combines logical thinking with relaxing gameplay. This minimalist puzzle challenges you to connect electrical lines and create complete circuits to light up lamps. With its clean design and soothing soundtrack, Energy offers a perfect balance of mental stimulation and stress relief for puzzle enthusiasts of all ages.

Core Features

Intuitive Line Connection Gameplay

The core mechanic revolves around clicking or tapping lines to rotate them into the correct positions. Your goal is to create complete electrical circuits that connect power sources to lamps, lighting up the entire network.

Progressive Difficulty System

Energy gradually introduces new gameplay elements and power sources as you advance. This thoughtful progression ensures that players can comfortably learn the mechanics while facing increasingly complex challenges that keep the game engaging.

Stress-Reducing Design Philosophy

The game features a calm, minimalist visual design paired with a relaxing soundtrack specifically crafted to help reduce stress. This makes Energy perfect for unwinding after a busy day while still exercising your brain.

Artistic Level Completion

As you successfully complete levels, the connected lines form beautiful images, adding an artistic element to your puzzle-solving achievements. This visual reward system provides additional motivation to progress through the game.

Built-in Hint System

When you're stuck on a challenging level, the game offers a helpful hint system. Simply press the lightbulb icon to get assistance with completing part of the level.

Game Mechanics

Energy operates on simple yet engaging principles:

  • Line Rotation : Tap any line segment to rotate it and change its connection points
  • Circuit Creation : Connect lines to form complete paths from power sources to lamps
  • Progressive Lighting : Successfully connected lamps will light up, providing visual feedback
  • Level Completion : Light up all lamps in a level to advance to the next challenge

Operation Guide

Basic Controls

  • Mouse Click/Tap : Rotate line segments to change their orientation
  • Hint Button : Located in the top-right corner (lightbulb icon) for when you need assistance
  • Visual Feedback : Lines light up when properly connected to power sources

Strategy Tips

  • Start by identifying the power sources and lamps in each level
  • Work systematically from power sources outward
  • Pay attention to which lines are already correctly positioned
  • Use the hint system when you're truly stuck rather than giving up

Progression System

Each completed level unlocks the next challenge, with new elements introduced gradually: - Early levels focus on basic line connection concepts - Mid-game introduces multiple power sources and complex routing - Advanced levels feature intricate patterns requiring careful planning

Why Play Energy?

Perfect Brain Training Tool

Energy provides excellent mental exercise by challenging your logical reasoning, spatial awareness, and problem-solving skills. The progressive difficulty ensures continuous learning and improvement.

Stress Relief and Relaxation

Unlike many puzzle games that can be frustrating, Energy is specifically designed to be calming. The minimalist aesthetics and peaceful soundtrack create a zen-like gaming experience.

Accessible for All Players

The simple tap-to-rotate mechanics make Energy accessible to players of all ages and skill levels. No complex controls or tutorials are needed - just pure puzzle-solving fun.

Free and Instantly Playable

Energy is completely free to play and runs directly in your web browser. No downloads, installations, or accounts required - just open and start solving puzzles immediately.

Educational Value

The game subtly teaches basic electrical circuit concepts while developing logical thinking skills, making it both entertaining and educational for players interested in STEM subjects.

Frequently Asked Questions (FAQ)