Matter Physics Plugin
The Matter Physics Plugin integrates the popular Matter.js 2D physics engine into your dill pixel game. It’s ideal for games requiring realistic physics simulations including gravity, collisions, constraints, and complex body interactions.
Key Features
- Full Matter.js physics engine integration
- Debug visualization support
- Configurable walls and boundaries
- Support for circles, rectangles, and complex polygon bodies
- Custom body definitions and properties
Add the plugin
Configure the plugin in your dill-pixel.config.ts:
Initialize physics in your scene:
Physics Objects
The plugin supports different types of physics entities. Here’s an example of creating various physics objects:
Configuration Options
The Matter Physics Plugin accepts several configuration options:
Example Implementation
For a complete example implementation, you can reference the Matter Physics Scene: