Jump to content

Phaser what physics for ...?


PhasedEvolution
 Share

Recommended Posts

3 hours ago, Tom Atom said:

Hi, if the effect is not part of gameplay, but visual effect only, then do not use physics for it and do it with tweens.

Look at this game: http://sbc.littlecolor.com/goblinrun/ - it has play button on menu screen, that wobbles every two seconds. Do you need something like this?

 

I am not sure. I want the body of (in this case) a circular sprite to be shaped according to the wobble. The phyisics body would be resized when the wobble happened... Would that happen?

Link to comment
Share on other sites

I haven't used any of the physics in Phaser, but I have done some game physics in the past. If you want to build a physics game that uses soft bodies like the one that tips4design linked to, it looks like you will need to use the P2 physics in Phaser. Each of those circles in that demo are circle rigid bodies, and each of the lines that connect them are springs. Once you have created all the bodies and connected them with springs, you can try changing the springs' stiffness and damping properties to change how stiff or squishy they are.

Link to comment
Share on other sites

13 minutes ago, lumoludo said:

I haven't used any of the physics in Phaser, but I have done some game physics in the past. If you want to build a physics game that uses soft bodies like the one that tips4design linked to, it looks like you will need to use the P2 physics in Phaser. Each of those circles in that demo are circle rigid bodies, and each of the lines that connect them are springs. Once you have created all the bodies and connected them with springs, you can try changing the springs' stiffness and damping properties to change how stiff or squishy they are.

Is it something like this? http://www.emanueleferonato.com/2012/09/21/step-by-step-creation-of-a-box2d-soft-body-blob/

Link to comment
Share on other sites

4 minutes ago, PhasedEvolution said:

Yes, that's pretty much it! You can see that the soft body is build a little differently in Emanuele's tutorial: there is a lot more space than in that Matter.js demo. But, they should both give you squishy things. The important thing is the usage of springs to connect several rigid bodies. In that tutorial they are called joints, but a joint that has the ability to compress or stretch like that can also be called a spring.

Link to comment
Share on other sites

Matter.js is agnostic of the rendering engine you attach to it so it should be possible, however, does it have features you don't have with P2? If your answer to that is no then just use the P2 instance that is already integrated with phaser and save yourself some complexity. Unless you want to fiddle with that complexity of course.

Link to comment
Share on other sites

41 minutes ago, mattstyles said:

Matter.js is agnostic of the rendering engine you attach to it so it should be possible, however, does it have features you don't have with P2? If your answer to that is no then just use the P2 instance that is already integrated with phaser and save yourself some complexity. Unless you want to fiddle with that complexity of course.

I am not really sure... I would like to implement soft bodies, that kind of jelly effect. I was told it could be done with something similar to this   http://www.emanueleferonato.com/2012/09/21/step-by-step-creation-of-a-box2d-soft-body-blob/ ... I didn't find any specific phaser tutorial for that... What do you think?

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...