If you need to swap out sprites or use a Player
instance across multiple scenes, then you should use no parent class and put the sprite in currentPlayer
. But you have to give only currentPlayer
to Phaser’s methods because it can’t do anything with the Player
instance itself. And you have to use the sprite’s coordinates in player.currentPlayer.x
etc.
If you don’t need any of that, then Player
can extend Arcade.Sprite
instead. Make sure the super
arguments match.
If the sprites are moving the debug display should show little velocity rays.