diff options
Diffstat (limited to 'lib/components')
| -rw-r--r-- | lib/components/points.js | 11 | ||||
| -rw-r--r-- | lib/components/points_collider.js | 35 | ||||
| -rw-r--r-- | lib/components/winner.js | 26 |
3 files changed, 72 insertions, 0 deletions
diff --git a/lib/components/points.js b/lib/components/points.js new file mode 100644 index 0000000..02b7e44 --- /dev/null +++ b/lib/components/points.js @@ -0,0 +1,11 @@ +import { Component } from '@serpentity/serpentity'; + +/** + * Component that stores points in arbitrary labels + * + * @extends {external:Serpentity.Component} + * @class PointsComponent + * @param {object} config a configuration object to extend. + */ +export default class PointsComponent extends Component {}; + diff --git a/lib/components/points_collider.js b/lib/components/points_collider.js new file mode 100644 index 0000000..ceec7ee --- /dev/null +++ b/lib/components/points_collider.js @@ -0,0 +1,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'; + } +}; + diff --git a/lib/components/winner.js b/lib/components/winner.js new file mode 100644 index 0000000..74de1c8 --- /dev/null +++ b/lib/components/winner.js @@ -0,0 +1,26 @@ +import { Component } from '@serpentity/serpentity'; + +/** + * Component that stores a winner + * + * @extends {external:Serpentity.Component} + * @class WinnerComponent + * @param {object} config a configuration object to extend. + */ +export default class WinnerComponent extends Component { + constructor(config) { + + super(config); + + /** + * The properthy that holds the winner + * + * @property {string} winner + * @instance + * @memberof WionnerComponent + */ + this.winner = this.winner || null; + } +}; + + |