src/HittableObject.js
/**
 * Hittable game objects
 *
 * @constructor
 * @auguments GameObject
 */
Hittable game objects
@constructor
@auguments GameObject
Hittable game objects @constructor @auguments GameObject
function HittableGameObject(displayHits, displayFlash) {
	if (displayHits === undefined) {
		return;
	}
	if (displayFlash === undefined) {
		displayFlash = true;
	}
	GameObject.apply(this, arguments);
	this.maxHits = 1;
	this.hitsRemaining = 1;
	this.invunerable = false;
	this.hittable = true;
	this.hitpointObservers = [];
	this.displayHitsTaken = displayHits;
	this.displayHitEffect = displayFlash;
	this.hitEffect = null;
	this.blockEffect = null;
	this.hitEffectOffset = new Vec2(0, 0);
	this.grace = 0;
	this.maxGrace = 2;
	this.healed = 0;
	this.maxHealed = 1;
	this.damTint = [255, 0, 0];
	this.healTint = [0, 255, 0];
	this.hitSounds = [];
	this.hitSounds[HitSoundType.kFlesh] = [];
	this.hitSounds[HitSoundType.kWood] = [];
	this.hitSounds[HitSoundType.kRock] = [];
	this.hitSounds[HitSoundType.kMetal] = [];
	this.annoyedDelay = 0;
	this.annoyedCount = 0;
	this.annoyedEnemyCount = 0;
	this.burning = false;
	this.annoyedCues = [];
	this.annoyedEnemyCues = [];
}
function HittableGameObject ( displayHits , displayFlash ) { if ( displayHits === undefined ) { return ; } if ( displayFlash === undefined ) { displayFlash = true ; } GameObject . apply ( this , arguments ) ; this . maxHits = 1 ; this . hitsRemaining = 1 ; this . invunerable = false ; this . hittable = true ; this . hitpointObservers = [ ] ; this . displayHitsTaken = displayHits ; this . displayHitEffect = displayFlash ; this . hitEffect = null ; this . blockEffect = null ; this . hitEffectOffset = new Vec2 ( 0 , 0 ) ; this . grace = 0 ; this . maxGrace = 2 ; this . healed = 0 ; this . maxHealed = 1 ; this . damTint = [ 255 , 0 , 0 ] ; this . healTint = [ 0 , 255 , 0 ] ; this . hitSounds = [ ] ; this . hitSounds [ HitSoundType . kFlesh ] = [ ] ; this . hitSounds [ HitSoundType . kWood ] = [ ] ; this . hitSounds [ HitSoundType . kRock ] = [ ] ; this . hitSounds [ HitSoundType . kMetal ] = [ ] ; this . annoyedDelay = 0 ; this . annoyedCount = 0 ; this . annoyedEnemyCount = 0 ; this . burning = false ; this . annoyedCues = [ ] ; this . annoyedEnemyCues = [ ] ; }
Hittable game objects
 @constructor
 @auguments GameObject
Hittable game objects @constructor @auguments GameObject