Particle Symphony ๐ตโจ

An interactive particle simulation showcasing the power and elegance of andygeiss/ecs โ a lightweight, high-performance Entity Component System framework for Go.
๐ฏ This project exists to demonstrate how simple yet powerful ECS architecture can be. Watch thousands of particles dance, interact, and create emergent beauty โ all powered by clean, modular ECS patterns.
๐ Live Demo
๐ Try it in your Browser โ
No installation required! The web version runs entirely in WebAssembly.
โก Powered By
| Technology |
Purpose |
| andygeiss/ecs |
๐ The star of the show! Lightweight ECS framework with bitmask-based entity filtering |
| raylib-go |
Native desktop rendering (high performance) |
| Ebitengine |
WebAssembly rendering (cross-platform) |
| Go |
Because simplicity and performance matter |
๐ Quick Start
Native Version (raylib)
For the best performance, run the native version:
# Clone the repository
git clone https://github.com/deltatree/showcase.git
cd showcase
# Build and run
go build -o particle-symphony . && ./particle-symphony
WebAssembly Version (Ebitengine)
Build the WASM version locally:
./build-wasm.sh
cd web && python3 -m http.server 8080
# Open http://localhost:8080
๐ฎ Controls
| Key |
Action |
1 |
Galaxy Preset |
2 |
Firework Preset |
3 |
Swarm Preset |
4 |
Fountain Preset |
5 |
Chaos Preset |
LMB |
Attract Particles |
RMB |
Repel Particles |
2ร Click |
Lock Attract/Repel |
F3 |
Toggle Debug Overlay |
ESC |
Exit (Native only) |
โจ Features
- Entity Component System - Clean, modular architecture
- Multiple Presets - Fountain, Firework, Galaxy, Swarm, and Chaos effects
- Real-time Physics - Gravity, damping, and velocity simulation
- Color Transitions - Smooth gradient color animations
- Lifetime Management - Particle birth, aging, and death cycles
๐๏ธ Architecture
The project follows a pure ECS architecture using andygeiss/ecs:
- Components - Pure data containers (Position, Velocity, Color, Mass, etc.)
- Systems - Logic processors (Physics, Render, Emitter, Gravity, etc.)
- Entities - Unique identifiers linking components together
- Bitmask Filtering - Blazingly fast entity queries using component masks
Why andygeiss/ecs?
โ
Zero Dependencies - Pure Go, no external requirements
โ
Bitmask-based Filtering - O(1) component lookups
โ
Clean API - Simple, intuitive, Go-idiomatic
โ
Battle-tested - Used in production game projects
โ
Minimal Footprint - Small codebase, easy to understand
// Example: How simple ECS can be!
particles := em.FilterByMask(MaskPosition | MaskVelocity | MaskColor)
for _, entity := range particles {
pos := entity.Get(MaskPosition).(*Position)
vel := entity.Get(MaskVelocity).(*Velocity)
pos.X += vel.X * deltaTime
pos.Y += vel.Y * deltaTime
}
๐ Project Structure
โโโ components/ # ECS component definitions
โโโ systems/ # ECS system implementations
โโโ presets/ # Particle effect presets
โโโ internal/ # Internal packages (config)
โโโ web/ # Web showcase page
โโโ cmd/wasm/ # WebAssembly version (Ebitengine)
โโโ docs/ # Project documentation
๐ Credits & Acknowledgments
This project wouldn't exist without these amazing open-source projects:
๐ License
MIT License - see LICENSE for details.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add some amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
Built with โค๏ธ and mass quantities of โ
If you found this useful, consider starring the repo and checking out andygeiss/ecs!