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/controller | |
parent | 5eae6f29a80cd47e268cb6eaefa96a0ab0a63e54 (diff) | |
download | rpgedit-e0eddb8741b840df97380e557abd51b47a5e2eee.tar rpgedit-e0eddb8741b840df97380e557abd51b47a5e2eee.zip |
Implement circle collidables
Diffstat (limited to 'src/controller')
-rw-r--r-- | src/controller/collision.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/controller/collision.ts b/src/controller/collision.ts index e1bd9f9..a44ffa4 100644 --- a/src/controller/collision.ts +++ b/src/controller/collision.ts @@ -1,5 +1,6 @@ import { Collision } from '../model/data/collision'; +import { Circle } from '../math/circle'; import { Collidable } from '../math/collision'; import { LineSegment, Movement } from '../math/line'; import { Point } from '../math/point'; @@ -26,6 +27,11 @@ export function mkCollision(collision: Collision[]): Collidable[] { ret.push(new Point(vec2.clone(v))); prev = v; } + break; + + case 'circle': + ret.push(new Circle(vec2.clone(c.center), c.radius)); + break; } } |