Overriding Phaser's kill() Method

Article by Richard Davey. Posted on 12th Feb 2015.   @phaser_

"This week’s effort was spent on basic battle mechanics (amongst many, many other things). I learned how to use Phaser to kill things and figured out targeting, attacking, and basic speech bubbles. This post concentrates on attacking and killing sprites."

image

"I’ve reorganized my classes to inherit from a base Character class. This class understands how to attack after moving towards a target (using agreed-upon animation names like attackright and attackdown). The attack() method itself uses the built-in Phaser.Sprite.damage() method."

Read the full tutorial