src/entities/Enemy.js
/**
	* Inits the death of an entity.
	*
	* @return {Enemy} A reference to this game entity.
	*/
Inits the death of an entity.
@return {Enemy} A reference to this game entity.
Inits the death of an entity . @return { Enemy } A reference to this game entity .
initDeath() {
		this.status = STATUS_DYING;
		this.endTimeDying = this.currentTime + this.dyingTime;
		this.velocity.set( 0, 0, 0 );
		for ( let behavior of this.steering.behaviors ) {
			behavior.active = false;
		}
		this.resetAnimations();
		const index = MathUtils.randInt( 1, 2 );
		const dying = this.animations.get( 'soldier_death' + index );
		dying.enabled = true;
		return this;
	}
initDeath ( ) { this . status = STATUS_DYING ; this . endTimeDying = this . currentTime + this . dyingTime ; this . velocity . set ( 0 , 0 , 0 ) ; for ( let behavior of this . steering . behaviors ) { behavior . active = false ; } this . resetAnimations ( ) ; const index = MathUtils . randInt ( 1 , 2 ) ; const dying = this . animations . get ( 'soldier_death' + index ) ; dying . enabled = true ; return this ; }
Inits the death of an entity.
Inits the death of an entity .
// reset all steering behaviors // reset all animations // start death animation