Interact

ClubCrawler.Actions. Interact

Source:

Contains functions for interactions, to be called when two objects interact, such as when a bullet strikes an enemy or an enemy strikes a player.

Interfaces

DamageDealer
Hurtable

Methods

(static) damageCollision(sourceObject, damagedObject) → {boolean}

Source:

Damages an object... calls die() if its health is less than or equal to 0

Parameters:
Name Type Description
sourceObject Object
Properties
Name Type Attributes Description
damage int

damage done

dealDamage function <optional>

function to call on source object upon hit of target

damagedObject Object
Properties
Name Type Description
health int

health to decrement

die function

Function to call if damagedObject dies

damage function

Function to call on damagedObject as it gets damaged

Returns:

Whether damage succesfully applied

Type
boolean

(static) validateDamage(damagedObject, sourceObject) → {boolean}

Source:

Description

Parameters:
Name Type Description
damagedObject any
sourceObject any
Returns:
Type
boolean