[BEHAVIOR] Chipmunk Physics

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

    I've seen the question come up often and there are two solutions.

    One is to pick one object and store it's values in a variables and then in a separate event pick the other one and use the values to do something. One quick thing you can save to a variable is the object's iid then you can use expressions like Sprite(1).x+sprite(2).x to add the x values of two separate instances for example.

    Another more useful thing you can do is to make a family containing only that one object type, then in events you can pick two separate instances independently. If you use C2's physics you have to use the family route.

    viewtopic.php?f=148&t=91829&p=718895&hilit=rope#p718895

    With the chipmunk behavior it makes things simpler, you specify the uid of the other object to attach the joint to and avoids having to use a family or even picking at all if you want to design joints in the editor.

    https://dl.dropboxusercontent.com/u/542 ... test2.capx

  • I've heard this has better results than box2d... might someone be able to tell me how to apply force at angle?

    I can see there's apply at offset, etc... but I'm trying to covert my current code over. Isn't it as simple as apply force at 90 degrees? I keep reading that this is used for joints etc... so am I using it for the wrong thing?

  • AnD4D

    I'm using chipmunk for racing game, and I have made the turning by applying force at offset:

    CasuRally

    Up arrow controls the force

    Left and Right controls the offset

  • neverk

    Surely that means you have to have a bunch of variables controlling such things. The simplicity of the normal physics engine is you just set the physics force strength and the angle.

    My code currently simulates something of a black hole. The closer you are to it, the greater the force. Can't see how I'd achieve the same with this one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AnD4D

    That could be achieved by setting force (polar) to

    force : max amount - clamp(distance(object.x,object.y,blackhole.x,blackhole.y),0,max amount)

    angle : angle(object.x,object.y,blackhole.x,blackhole.y)

  • I use chipmunk for the joint capabilities, here is something I was working on last year:

  • Please someone help me, I have a falling box with physics behavior i want to change his direction when i swipe, the box will move to right or to left and continue to fall as the image below

    Im using chipmunk plugin

  • Hello MarkeGamer,

    I've never used the touch but, basicaly I think just check the direction of the touch (with somethin like touch start and touch end, I don't know) and apply an impulse with Chipmunk physics at that direction or an angle (switch to polar when setting the impulse).

  • MarkeGamer you could do it like

    is in touch Box Set angle towards (touch.x)

    (Touch.y)

  • Hello MarkeGamer,

    I've never used the touch but, basicaly I think just check the direction of the touch (with somethin like touch start and touch end, I don't know) and apply an impulse with Chipmunk physics at that direction or an angle (switch to polar when setting the impulse).

    Thanks for reply can you please give me a sample example if you want im newbies in construct 2

  • MarkeGamer you could do it like

    is in touch Box Set angle towards (touch.x)

    (Touch.y)

    please can you tell me how with an example coz im a newbie in construct 2

  • MarkeGamer you will find demo here and many more as you are newbie in construct 2

    https://www.dropbox.com/s/djjowh9avzqpb ... .capx?dl=0

  • MarkeGamer you will find demo here and many more as you are newbie in construct 2

    https://www.dropbox.com/s/djjowh9avzqpb ... .capx?dl=0

    Firstable thanks for your reply in fact it's almost what i need except one thing i want the green box, falling down to the bottom even when i change his direction as you did in your code

  • MarkeGamer See Falling demo again and let me know is that what you want?

    https://www.dropbox.com/s/8d2a8zt685mf8 ... .capx?dl=0

    many more as you are newbie in construct 2

    https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0

  • MarkeGamer See Falling demo again and let me know is that what you want?

    https://www.dropbox.com/s/8d2a8zt685mf8 ... .capx?dl=0

    many more as you are newbie in construct 2

    https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0

    Thanks Lordshiva1948 but i guess you put the wrong file coz it's talking about uploading files from computer i see no falling box there

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