xjxxjx1017 / Destructible-Terrain-With-Phaser

A phaser implementation of destructible terrain helper library for 2D games. Using quad-tree algorithm, typescript and Phaser 3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Example

Instructions

  1. run npm install
  2. 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

  1. Destructible object collision check with another moving destructible object? Returns 2 points where the destructible object first reached each other.

  2. Desctructable Object save/load (serialization) ( already done in /spacewarrealism repo, wait for pulling )

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

About

A phaser implementation of destructible terrain helper library for 2D games. Using quad-tree algorithm, typescript and Phaser 3.

License:MIT License


Languages

Language:TypeScript 94.3%Language:JavaScript 3.1%Language:HTML 2.1%Language:Batchfile 0.5%