Jump to content

Search the Community

Showing results for tags 'createSpring'.

  • 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. Hola amigos! Is there a createSpring function with arcade physics? I'm in development of a platformer and I want my character to have a rope-like ability. Kind of like give up robot, but first of all I need to know how to create a spring between two objects. I've tried creating an object with p2 physics tracking the characters position. When the rope ability is called the positions is swapped. Lets just say it didn't meet the requirements (it's greasy): rope: function() { if (this.cursors.up.isDown) { this.ropeSpring = this.game.physics.p2.createSpring(this.testP2.body, this.springBox.body, 5, 0.5, 0.5); this.line.setTo(this.testP2.x, this.testP2.y, this.springBox.x, this.springBox.y); this.drawLine = true; } else { this.game.physics.p2.removeSpring(this.ropeSpring); this.drawLine = false; } }, springTest: function() { if(!this.drawLine) { this.testP2.body.x = this.character.body.x; this.testP2.body.y = this.character.body.y; } else if(this.drawLine) { this.character.body.x = this.testP2.body.x; this.character.body.y = this.testP2.body.y; } },
×
×
  • Create New...