Psychedelic Game of Life
This visualization implements Conway's Game of Life with a psychedelic twist:
- Vibrant color cycling based on cell position and time
- Improved performance using optimized algorithms and requestAnimationFrame
- Interactive controls to reset the simulation or toggle color effects
- Click to toggle cells and drag to paint new living cells
- Mesmerizing trail effects creating an infinite tunnel-like visual experience
The Game of Life
Conway's Game of Life is a cellular automaton devised by mathematician John Conway in 1970. It follows simple rules:
- Any live cell with fewer than two live neighbors dies (underpopulation)
- Any live cell with two or three live neighbors lives on
- Any live cell with more than three live neighbors dies (overpopulation)
- Any dead cell with exactly three live neighbors becomes alive (reproduction)
Features
- Psychedelic Visuals: Cells are rendered with position-dependent colors that cycle over time
- Visual Trails: Previous frames are preserved with a fading, zooming effect creating a sense of depth
- Interactive Controls: Reset the grid, toggle color effects, or disable trail effects
- Drawing Mode: Click and drag to create patterns
- Optimized Performance: Uses canvas for rendering and efficient algorithms for grid updates
How To Use
- Click on any cell to toggle its state
- Click and drag to draw living cells
- Use the Reset button to generate a new random pattern
- Toggle the Colors button to enable/disable the psychedelic color cycling
- Toggle the Trails button to enable/disable the trail effect
Technical Implementation
This visualization uses:
- D3.js for DOM manipulation and event handling
- HTML5 Canvas for efficient rendering of thousands of cells
- requestAnimationFrame for smooth animation performance
- Module architecture separating game logic, rendering, and initialization
- Visual echo effect using canvas composition techniques
Enjoy the hypnotic patterns that emerge from simple rules!