function Player(x, y, maxHealth) { this.sprite = game.add.sprite('player'); this.health = maxHealth; this.maxHealth = maxHealth; } Player.prototype = { update: function() { this.sprite.animations.play('idle'); } };