collapse Effect into Ability
This commit is contained in:
+4
-3
@@ -32,8 +32,8 @@ export default class Projectile {
|
||||
this.#homingTarget = value
|
||||
}
|
||||
|
||||
constructor(...options) {
|
||||
Object.entries(options).forEach((value, key) => this[key] = value)
|
||||
constructor(options = {}) {
|
||||
Object.entries(options).forEach(([key, value]) => this[key] = value)
|
||||
}
|
||||
|
||||
get game() { return this.#game }
|
||||
@@ -44,10 +44,11 @@ export default class Projectile {
|
||||
set x(value) { this.position.x = value }
|
||||
set y(value) { this.position.y = value }
|
||||
set destination(value) { this.#dest = value }
|
||||
set position(value) { this.#position = value }
|
||||
|
||||
checkCollisions() {
|
||||
(this.game?.entities ?? []).filter((e) => e.id != this.id).forEach((e) => {
|
||||
if (e.id == this.owner) { return }
|
||||
if (e.id == this.owner?.id) { return }
|
||||
|
||||
if (SATX.collideObject(this.collider, e.collider)) {
|
||||
this.onCollide(this, e)
|
||||
|
||||
Reference in New Issue
Block a user