Jump to content

Search the Community

Showing results for tags 'alter'.

  • 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. Hi I'm working on a prototype and have some problems with P2. I've some bubbles in the scene which grow over time. When changing the body's radius in the update function the whole scene gets out of control and the bubbles go crazy, jumping around everywhere. create: function() { this.game.physics.startSystem(Phaser.Physics.P2JS); for (var i = 0; i < 10; i++) { var x = (Math.random() * this.game.width) | 0, y = (Math.random() * this.game.height) | 0, d = 30; var s = this.game.add.sprite(x, y, ''); s.anchor.set(0.5, 0.5); this.game.physics.p2.enable(s); var p2Shape = s.body.addCircle(d, 0, 0, 0); s.body.debug = true; this.objects.push({ sprite: s, physicShape: p2Shape }); } }, update: function() { for (var i = 0; i < this.objects.length; i++) { var o = this.objects[i]; // same result //o.sprite.body.setCircle(o.physicShape.radius + 0.1, 0, 0, 0); o.physicShape.radius += 0.1; o.physicShape.boundingRadius = o.physicShape.radius; } }Am I doing something terribly wrong here?
×
×
  • Create New...