Jump to content

Search the Community

Showing results for tags 'oo'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Following this example: https://phaser.io/examples/v2/sprites/extending-sprite-demo-1 I've been trying to extend MonsterBunny. I've added this: // here is an extension of a custom game object SuperMonsterBunny = function (game, x, y, rotateSpeed, vertSpeed) { MonsterBunny.call(this, game, x, y, rotateSpeed); this.vertSpeed = vertSpeed; this.ydir = 1; }; SuperMonsterBunny.prototype = Object.create(MonsterBunny.prototype); SuperMonsterBunny.prototype.constructor = SuperMonsterBunny; SuperMonsterBunny.prototype.update = function() { /* this.y += this.vertSpeed * this.ydir; if (this.y < 0 || this.y > h) { this.ydir *= -1; } */ }; This works fine, and the commented out code works as expected. (when it's uncommented!) The extended class's update overrides the parent class, which is expected, but, I can't find a way of calling super.update() or equivalent. Can anyone enlighten me?
×
×
  • Create New...