Ogre

ClubCrawler.Objects. Ogre

A class for an Ogre enemy. Uses an atlas w sprite animations

Constructor

new Ogre(config)

Source:
Implements:

Constructs the ogre. Ogre uses sensePlayerRepeat action to determine behavior based on player distance.

Parameters:
Name Type Description
config ClubCrawler.Types.EnemyConfig

The configuration object

Properties
Name Type Description
scene Phaser.Scene

The creating scene

item Item

The Tiled item having the x,y etc

Extends

  • Phaser.GameObjects.Image

Members

(static, constant) DEFAULT_OGRE_STATS

Source:

Default characteristics for the ogre - health, speed, damage, coin result, etc

Methods

dealDamage()

Source:

Plays damage sound

die()

Source:

Called internally if the result of, for example, takeDamage causes it to die

Can clean up any other objects it needs to, like ongoing events, when it dies

Fires:

hit(bullet) → {any}

Source:
Deprecated:
  • old bullet interaction
Parameters:
Name Type Description
bullet any
Returns:
Type
any

sense(sensation)

Source:

Implementation of the sense interface.

This is where Ogre determines action depending on player distance.

Uses either moveRandomly or moveTowardsPlayer actions.

Parameters:
Name Type Description
sensation ClubCrawler.Types.SensationConfig

takeDamage(damage)

Source:

Called by collision function. Can react to damage here.

Parameters:
Name Type Description
damage number

amount of damage taken