diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-11-08 22:26:11 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2018-11-08 22:26:11 +0100 |
commit | e0eddb8741b840df97380e557abd51b47a5e2eee (patch) | |
tree | 43fadcde4292437b14dcece8a0d85da560a4eb94 /src/model/data | |
parent | 5eae6f29a80cd47e268cb6eaefa96a0ab0a63e54 (diff) | |
download | rpgedit-e0eddb8741b840df97380e557abd51b47a5e2eee.tar rpgedit-e0eddb8741b840df97380e557abd51b47a5e2eee.zip |
Implement circle collidables
Diffstat (limited to 'src/model/data')
-rw-r--r-- | src/model/data/collision.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/model/data/collision.ts b/src/model/data/collision.ts index 5008fa3..29d0879 100644 --- a/src/model/data/collision.ts +++ b/src/model/data/collision.ts @@ -1,6 +1,12 @@ -export interface CollisionPolygon { +export interface PolygonCollision { readonly type: 'polygon'; readonly vertices: Array<[number, number]>; } -export type Collision = CollisionPolygon; +export interface CircleCollision { + readonly type: 'circle'; + readonly center: [number, number]; + readonly radius: number; +} + +export type Collision = PolygonCollision | CircleCollision; |