
Created in 1970 by mathematician John Horton Conway, this cellular automaton simulation operates on a 2D grid where cells evolve based on three rules:
- Any live cell with 2 or 3 neighbors survives
- Any dead cell with 3 live neighbors becomes alive
- All other cells follow standard death/stasis patterns
Core Data Structures
The implementation uses component-based architecture with these key structures:
LifeStatus Component: Tracks whether a cell is alive (1) or dead (0)
LifeStatusNextCycle Component: Implements double buffering to prevent mid-frame state conflicts, ensuring all cells evaluate based on the same generation’s data
Neighbors Component: Stores references to up to 8 adjacent cell entities (cardinal and diagonal directions)
Game Logic System
The LifeVerificationSystem handles cellular evolution through two sequential jobs:
- Evaluation Job: Counts live neighbors for each cell and updates
LifeStatusNextCycleaccording to Conway’s rules - Update Job: Transfers the computed next state to
LifeStatusand adjusts cell visibility via scale values
The system processes updates at 0.5-second intervals, though manual advancement is available.
Grid Construction
The GameHandler class creates a configurable grid (up to 1000×1000 cells), establishing neighbor relationships between entities and positioning them based on world bounds. Scale constants enable efficient visibility toggling without conditionals.
Source Code
Full implementation available on my GitHub repository.