Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samme/phaser-ondamaged-signal

Adds Phaser.Sprite#onDamaged signal
https://github.com/samme/phaser-ondamaged-signal

phaser

Last synced: 28 days ago
JSON representation

Adds Phaser.Sprite#onDamaged signal

Awesome Lists containing this project

README

        

It's dispatched after damage is applied but **before** the sprite is killed (if necessary).

```javascript
var sprite = game.add.sprite();

sprite.onDamaged.add(function (amount, health, maxHealth){
// …
}, sprite);
```