[BEHAVIOR] Chipmunk Physics

From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • CreativeMind

    None to my knowledge, but I only use HTML export. However there shouldn't be since it's just math an JavaScript and JavaScript should ru the same everywhere.

  • hi R0J0hound

    a question,can i use this physical system on horizontal scrolls games or tileset rpg game(not a platform game),Simulation wooden cases after breaking pieces of physics,or item drops on the ground after collision of physics,like “Wayward Souls”,I've used your sample sliding wall,i think is better than physical system,but i don't know how to do a simulation wooden cases breaking pieces physics,or is just a simple animation?

  • corpvs2

    Top view can be done by setting the gravity to 0.

    To break up physics objects it's either a matter of using an animation or creating the fragment objects over the object, then destroying the original object.

  • R0J0hound

    thank you!!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I still don't understand the force and impulse section.

    Say I want to have an object spawn randomly on my layout and then launch itself at a random impulse value toward a random location on the layout...

    Can anyone tell me what do I use to do that? Rect or Polar?

    And what does offset mean? I'd like to make the shift over to this, rather than standard physics, but this one part doesn't seem too user friendly.

  • AnD4D

    Polar would work for that, just set the angle to the angle to that location from the object and magnitude can be the force amount.

    You can ignore the offset if you like. With zeros it's applying the force to the center of mass on the object. The offset specifies a position from the center of mass, which in turn would give some torque.

  • Nice work hound

  • Just starting to play around with chipmunk physics.

    I've setup this little test scene

    https://dl.dropboxusercontent.com/u/403350/chipmunktest/chipmunktest.capx

    There's 2 things im trying to figure out.

    1) If you drag the box upwards quickly, the ball sinks into it about halfway, then slowly pushes up to its proper position. Is there any way to make that quicker? or not sink into the other object at all?

    2) If you drag the box down wards quickly, the ball bounces several times like its made of metal or something. Even though elasticity is set to 0 on both objects. Any way to reduce the bouncing?

    Thanks!

  • justifun

    I think the version of chipmunk used is just kind of spongy. The only thing you can tweak is "space iterations" but that has no effect on the sponginess there. It won't be as spongy if you move by changing velocity or even better acceleration I suppose, but that may not always be possible.

  • R0J0hound - how would you move the square around to follow the mouse via velocity and acceleration?

  • justifun

    First you need to make the box movable.

    velocity way:

    set velocity to rect((mouse.x-sprite.x)*10, (box.y-box.y)*10)

    and set it to 0 when not dragging

    acceleration way:

    Keep the box from falling from gravity with:

    on box prestep

    --- apply force rect(0, -gravity*mass)

    and give the box a max speed at the start of the layout.

    then to move:

    apply force rect((mouse.x-sprite.x)*1000, (box.y-box.y)*1000)

    and when not dragging give a slowing force.

    apply force rect( -velocityx*1000, velocityy*1000)

  • R0J0hound - ill give it a go! I would have never guessed that. I'm new to the physics stuff.

  • How do I get to use the Chipmunk Physics with construct 2?

  • jkleffel

    You can download it in the first post. There's also a sticky topic on how to install plugins.

  • Is it possible to get a perfect ellipse collision? Tried scaling vertically an object with circle collision shape, but it does not work.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)