FogOfWarViewer

FogOfWarViewer

new FogOfWarViewer()

Source:

Subclass of FogOfWar. Object tracks the movement of target object and radius for Field of View.

Methods

checkMove() → {Boolean}

Source:

Checks to see if the target object has changed positions.

Returns:
  • True if target object has changed X or Y location in World Coordinates.
Type
Boolean

getRadius() → {Number}

Source:

Returns the value of radius for Field of View for this object.

Returns:
  • Radius in World Coordinates.
Type
Number

getTarget() → {Object}

Source:

Returns the target object.

Returns:
  • Target object for this FogOfWarViewer.
Type
Object

getX() → {Number}

Source:

Returns the X location in World Coordinates.

Returns:
  • X location in World Coordinates.
Type
Number

getY() → {Number}

Source:

Returns the Y location in World Coordinates.

Returns:
  • Y location in World Coordinates.
Type
Number

removeTarget()

Source:

Removes the target object from FogOfWarViewer object.

setRadius(r)

Source:

Changes the size of radius for a Field of View.

Parameters:
Name Type Description
r Number

New radius in World Coordinates.

setTarget(t, r)

Source:

Sets the target and radius for an object to have a Field of View.

Parameters:
Name Type Description
t Object

Already created object for the Fog Of War to track.

r Number

Radius in World Coordinates.

update()

Source:

Updates the previous X and Y location.