Jump to content

Circle physics


yegorf1
 Share

Recommended Posts

Hello! I tried to make my game with physics. Prototype you can find here. First goes blue, than red, green, yellow. You can't win or lose, yet. As you can see, I use circles, but I use Phaser.Physics.ARCADE too and it doesn't support circles, so now there're squares instead of circles. How can I fix it?

 

.Sorry for bad english

Link to comment
Share on other sites

you mean you've tried p2 physics and didn't find out how to define a collision between 2 circle shapes?  have you read the examples ?

http://examples.phaser.io/sideview.html

 

search for the p2 collision examples :)

 

Yep, thanks for all this. I already found it, but forgot to write here. And now I have problem when I'm trying to drag chip. For that, I need to kill it and reset - I think it's slow and not right way.

Link to comment
Share on other sites

Again did it by myself:

if (isInBounds(BOUNDS[chip.owner], chip.y)) {	if (frame % 5 == 0) {		chip.oldPos = { x: chip.x, y: chip.y };	}	chip.body.velocity.x = 10 * (chip.pointer.worldX - chip.x);	chip.body.velocity.y = 10 * (chip.pointer.worldY - chip.y);} else {	stopDrag(chip, chip.pointer);}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...