Destructible Terrain With Phaser
A work in progress.
Current progress - example screenshot:
The below example show 4 destructible objects.
- Terrain blocks are rendered with hollow green frames.
- Destroyed blocks are rendered with hollow red frames.
- The bottom right object is constructed by using other destructible objects. Rendering by textures.
- Yellow double circles, showing ray-to-mouse-position collision statuses with all objects.
Instructions
- run npm install
- run devserver.bat
Features
- Support draw/erase with circles, triangles, rectangles, lines
- Destructible objects base class, allow extends, support draw/erase with another destructible object.
- Support collision check with static or moving points, lines.
- Calculation for area
- Examples
Environment
- Phaser 3, Typescript, Lodash, Webpack
Task List
-
Destructible object collision check with another moving destructible object? Returns 2 points where the destructible object first reached each other.
-
Desctructable Object save/load (serialization) ( already done in /spacewarrealism repo, wait for pulling )
-
Place each destructible object in a Phaser Container, so that it is controllable as a single object. May need to deal with point transformations.
Pending Task List (implement on high demand only)
- Moving destructible objet colision with a static line