A physics-based game where you control a black hole and consume celestial objects to grow. Created by my son Christopher (6) who is really interested in black holes!
- Realistic gravitational lensing effect using Three.js post-processing
- Physics-based interactions with gravitational pull
- Beautiful cosmic visuals with stars, nebulae, and distortion effects
- Grow your black hole by consuming celestial objects
- main: Current stable version with orthographic camera (2D view)
- 3D_cam: Development branch for converting to a 3D perspective camera while maintaining gameplay
For details on the 3D camera conversion approach, see the 3D_CAMERA_NOTES.md file.
- Clone this repository:
git clone https://your-repository-url.git
cd christophers_game- Install dependencies:
npm install- Start a local server:
npm start- Open your browser and navigate to http://localhost:3000
You can also run this directly with any local server. For example, using Python:
# Python 3
python -m http.server
# Python 2
python -m SimpleHTTPServerThen open your browser to http://localhost:8000
This project uses modern ES6 modules to import Three.js and its components. This approach is recommended by the Three.js team and will be the only supported method in future versions.
The main effects in the game rely on:
- Three.js rendering for the game objects
- Custom shader materials for the black hole visuals
- Post-processing effects for gravitational lensing
The game requires a modern browser that supports ES6 modules, WebGL, and advanced JavaScript features. For best performance, use the latest versions of Chrome, Firefox, Safari, or Edge.
- Built with Three.js
- Inspired by astrophysics and gravitational phenomena