Constructor
new GameCoin(config, item)
- Source:
- See:
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Configuration Properties
|
||||||||||||||||||||
item |
Phaser.Types.Tilemaps.TiledObject | item structured by Tiled as per Phaser.Types.Tilemaps.TiledObject Properties
|
Extends
- Phaser.GameObjects.Image
Members
coinValue :number
- Source:
- Default Value:
- 1
The value of the coin
Type:
- number
spinning :boolean
- Source:
- Default Value:
- false
Whether the coin has already been triggered
Type:
- boolean
Methods
fadeCoin()
- Source:
The fade out function for the coin. 'This' scope is the Coin, as applied by scene.time.delayedCall. Callback triggered on a timer after spinning starts. Shrinks coin and deletes it after it shrinks to nothing.
overlapWithPlayer(player, coin)
- Source:
Callback function applied when player touches the coin. Increases the score and begins spinning the coin.
Parameters:
Name | Type | Description |
---|---|---|
player |
ClubCrawler.Objects.Player | The player |
coin |
ClubCrawler.Objects.GameCoin | The coin |