aboutsummaryrefslogtreecommitdiff
path: root/lib/components/points_collider.js
blob: ceec7eecf0c4dd205c3107328ae76ab5e0858bd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Component } from '@serpentity/serpentity';

/**
 * Component that stores a collision target and points accumulation
 * target
 *
 * @extends {external:Serpentity.Component}
 * @class PointsColliderComponent
 * @param {object} config a configuration object to extend.
 */
export default class PointsColliderComponent extends Component {
  constructor(config) {

    super(config);

    /**
     * The target entity that will generate points if it collides
     *
     * @property {external:Serpentity.Entity} collisionTarget
     * @instance
     * @memberof PointsColliderComponent
     */
    this.collisionTarget = this.collisionTarget || null;

    /**
     * The target entity that will generate points if it collides
     *
     * @property {string} pointsTarget
     * @instance
     * @memberof PointsColliderComponent
     */
    this.pointsTarget = this.pointsTarget || 'nobody';
  }
};