Jump to content

Search the Community

Showing results for tags 'p2.js object interaction'.

  • 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. Hey guys and gals, So I'm creating an AI (using p2.js) and want to update its position (vertical only) using another object's position (only getting the vertical position). I have this code here (which is in object 1's update update function): game.scene.<object2>.body.position[1] = game.scene.<object 1>.body.position[1];Which works, but, when either object collides with something, object 2 dissapears and it appears that object 1 goes straight through it (where previously it hit it and bounced off). The restitution and mass of the other objects are 1 and the max number possible respectively, as is object 2. Previously I had been setting an initial speed for object 1 to move at (as a global variable in the objects.js class) and then using that same value for object 2, and it worked, but it didn't update naturally (object 1 moves in both x and y axis, whereas object 1 only moves in the y axis). This ai is the last piece in the puzzle to completing the game and its rediculously frustrating hitting my head against the table repeatedly to make it work! Any help would be much appreciated!
×
×
  • Create New...