Skip to content

georgeantonopoulos/singularity

Repository files navigation

Christopher's Singularity - A Cosmic Feast Game

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!

Features

  • 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

Development Branches

  • 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.

Installation

Local Development

  1. Clone this repository:
git clone https://your-repository-url.git
cd christophers_game
  1. Install dependencies:
npm install
  1. Start a local server:
npm start
  1. Open your browser and navigate to http://localhost:3000

Without npm (Simple Method)

You can also run this directly with any local server. For example, using Python:

# Python 3
python -m http.server

# Python 2
python -m SimpleHTTPServer

Then open your browser to http://localhost:8000

Technical Notes

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:

  1. Three.js rendering for the game objects
  2. Custom shader materials for the black hole visuals
  3. Post-processing effects for gravitational lensing

Browser Support

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.

Credits

  • Built with Three.js
  • Inspired by astrophysics and gravitational phenomena

About

Singularity - A gravitational game for Christopher

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages