In my case, I'm using the Phaser framework.

So in this example I'm extending the Group class of phaser. Every 'actor' class (Sprite, Group, ...) calls upon the `update()` prototype every few miliseconds.

My idea was to extend this function only when the application runs on a desktop (so not on a phone).

for example:

```
var MousePointer = function (game, parent, name) {
  Phaser.Group.call(this, game, parent, name);
  this.init();
};

MousePointer.prototype = Object.create(Phaser.Group.prototype);
MousePointer.prototype.constructor = MousePointer;

MousePointer.prototype.init = function () {
  // ... init
};

MousePointer.prototype.update = function () {
  // Do something when on desktop
};

```

I can't possibly use an if clausule in the `update()` function to check whether the player is on dekstop/tablet/phone. So is there a way to actually override the prototype on initialisation?

for example (pseudocode):

```
if(onPhone)
  MousePointer.prototype.update = parent.prototype.update;
else
  MousePointer.prototype.update = this.update;

```