]>
git.r.bdr.sh - rbdr/sumo/blob - lib/components/grab.js
1 import { Component
} from '@serpentity/serpentity';
4 * Component that stores a dash skill
6 * @extends {external:Serpentity.Component}
8 * @param {object} config a configuration object to extend.
10 export default class GrabComponent
extends Component
{
16 * The properthy that holds the grab state
18 * @property {boolean} grabbing
20 * @memberof GrabComponent
22 this.dashing
= this.grabbing
|| false;
25 * The constraint used for the grab
27 * @property {external:MatterJs.Constraint} constraint
29 * @memberof GrabComponent
31 this.constraint
= this.constraint
|| null;
34 * Whether the grab is locked from occuring
36 * @property {boolean} locked
38 * @memberof GrabComponent
40 this.locked
= this.locked
|| false;
43 * Cooldown before lock is removed
45 * @property {number} cooldown
47 * @memberof GrabComponent
49 this.cooldown
= this.cooldown
|| 3000;
54 * @property {number} currentCooldown
56 * @memberof GrabComponent
58 this.currentCooldown
= 0;