Lights Out - Classic Puzzle Game

Seele01-Flash
By
Lights Out is a classic logic puzzle game that challenges your problem-solving skills. Turn off all the lights on the grid, but beware - each click affects adjacent lights too!

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Lights Out 3D". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** A retro-futuristic, tactile 3D puzzle board inspired by 90s handheld electronic toys. The aesthetic should be "Glossy Plastic" mixed with "Neon Synthwave". * **Color Palette:** Deep violet/magenta background (similar to the screenshot). The buttons should be circular. * **OFF State:** Dark chocolate/black plastic material (low roughness). * **ON State:** Glowing amber/orange with high emissive intensity. * **Geometry:** Create a 5x5 grid of circular buttons sitting on a rounded rectangular base. Each button should be a separate mesh to allow for individual animation. * **Lighting & Effects:** * Use a soft purple ambient light to illuminate the base. * The "ON" buttons should cast real light (or simulate it via an emissive bloom effect). * **Mobile Optimization:** Use low-poly cylinders for buttons (segments=16 or 32). Avoid heavy real-time shadow maps; use baked lighting or simple directional light. ### 2. Audio Requirements * **BGM:** A subtle, looping ambient synth track (low-fi or synthwave style) that aids concentration. * **Sound Effects (SFX):** * **Toggle Click:** A satisfying, crisp mechanical "plastic switch" sound. Pitch shift slightly up when turning ON, and slightly down when turning OFF. * **Win Jingle:** A short, harmonized 8-bit ascending arpeggio when the board is cleared. * **Reset:** A mechanical "whir" or sliding sound. ### 3. Gameplay Loop * **Core Mechanic:** The game features a 5x5 grid of lights. When a player taps a light, that light and its four adjacent neighbors (Up, Down, Left, Right) toggle their state (On $\leftrightarrow$ Off). * **Goal:** The objective is to turn **all lights OFF** (to match the game title). * **Level Generation:** The board must start in a solvable state. Do **not** fully randomize the grid. Instead, start with an "All Off" board and simulate 10-20 random valid moves programmatically to scramble it. This guarantees a solution exists. * **Progression:** Track the "Move Count". When the player wins, display a "Level Complete" overlay and a "Next Level" button that generates a new puzzle. ### 4. Mobile Controls & Interaction * **Camera & Orientation:** Fixed perspective camera, angled slightly top-down (approx 60 degrees) to give depth to the buttons while keeping the grid legible. Optimized for **Portrait Mode**. * **Touch Interaction:** * Implement `THREE.Raycaster` for precise touch detection. * **Visual Feedback:** When tapped, the button mesh should physically depress (animate z-position down and up) using a tweening library (like TWEEN.js or GSAP) to mimic a physical button press. * **Haptic Feedback:** Trigger `navigator.vibrate(15)` on every valid tap to provide tactile satisfaction. * **UI Layout:** * Top of screen: "Level" and "Moves" counters (large, legible font). * Bottom of screen: A "Reset" button (placed comfortably within the thumb zone). * Ensure UI buttons have a minimum touch target of 44x44 pixels. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Lights Out is a timeless puzzle game that has captivated players for decades with its deceptively simple yet mind-bending gameplay. Rated 3.0/5 by puzzle enthusiasts, this brain teaser challenges you to turn off all the lights on a grid-based board. However, there's a twist that makes this puzzle incredibly challenging - every time you click on a light, it toggles not only that light but also all adjacent lights.

Core Features

Classic Puzzle Mechanics

The game features the original Lights Out puzzle format with a grid of illuminated lights. Your objective seems simple: turn all lights off. But the interconnected nature of the lights creates a complex web of cause and effect that requires strategic thinking.

Brain Training Benefits

This puzzle game is perfect for: - Logic Development : Each move requires careful consideration of consequences - Pattern Recognition : Success depends on identifying winning patterns - Strategic Planning : You must think several moves ahead - Problem-Solving Skills : The game enhances analytical thinking

Accessible Gameplay

  • Free to Play : No payment required, completely free online experience
  • No Download Needed : Play instantly in your browser
  • All Ages Content : Suitable for puzzle lovers of any age
  • Quick Sessions : Perfect for short brain training breaks

Game Mechanics

The Light Toggle System

When you click on any light, several things happen simultaneously: 1. The clicked light changes state (on becomes off, off becomes on) 2. All directly adjacent lights (up, down, left, right) also toggle 3. The challenge is to find the right sequence of clicks to turn all lights off

Strategic Depth

What makes Lights Out particularly challenging is that there's often only one correct solution path. Random clicking rarely works - success requires understanding the mathematical patterns behind the light interactions.

Gameplay

The game presents you with a grid where some lights are on (bright) and others are off (dark). Using only mouse clicks, you must manipulate the lights to achieve the goal state where all lights are turned off.

Winning Strategies

  • Corner Strategy : Start with corner lights as they have fewer adjacent connections
  • Pattern Analysis : Look for repeating patterns that can help solve sections
  • Systematic Approach : Work methodically rather than randomly clicking
  • Reverse Engineering : Sometimes it helps to work backwards from the solution

Operation Guide

Controls are incredibly simple: - Mouse Click : Click on any light to toggle it and adjacent lights - No Special Keys : The entire game is controlled with just mouse clicks - Visual Feedback : Lights clearly show their on/off state

Objective: Turn all lights on the board to the "off" state (dark). The puzzle is solved when no lights are illuminated.

Why Play This Game

Lights Out offers a perfect blend of simplicity and complexity that makes it endlessly engaging. It's an ideal choice for:

  • Puzzle Enthusiasts : Classic brain teaser with deep strategic elements
  • Quick Gaming Sessions : Each puzzle can be completed in minutes
  • Mental Exercise : Excellent for keeping your mind sharp
  • Stress Relief : Focused problem-solving can be meditative
  • Skill Building : Develops logical thinking and pattern recognition

The game's mathematical foundation means there's always a definitive solution - it's just a matter of finding it. This guarantee of solvability makes it satisfying rather than frustrating, as you know persistence will pay off.

Frequently Asked Questions (FAQ)