[Joints] Crazy Snake instead of my lamp

0 favourites
From the Asset Store
A collection of well organized sprites to build your own Crazy monkey slot game
  • Hello everyone,

    I'm here because of my snake which is a lamp. I mean, it supposed to be a lamp, so 3 rectangles and 1 triangle with some pivot joints for hold them together. But I certainly missed a step, and now the thing is on the ground with horrific spasms, like a demonic snake which tries to reach a yoghurt river or whatever.

    To be precise, here's a small drawing and the action related to it. As you may understand, a rectangle is a link, so several rectangles connected will be a string. But look at these two rectangles with two image point, I make the joint by connecting their image points...isn't that how we're supposed to do it ? What's wrong exactly ?

  • Guys ? Someone ? Okay I was maybe too specific, in brief, how can I make a realistic string by using joints and physic objects ?

    I can join the capx of my previous attempt if you need it (the one with the crazy shit on the ground, be careful I bet this thing want to eat your head or something). I just want to build a physical lamp hanging from the ceiling which reacts well realisticly with another physical object (like my sprite or a rock or I don't know, your favorite duck for instance). You know, this kind of stuff :

    The way I see it, it's a movable object (the lamp itself) related to an immovable object (the ceiling) thanks to a pivot joint (the cable). Am I wrong ? If I'm not, why are all my attempts "alive" and "hyperactive" as soon as I define the corresponding joint ? Thanks in advance

  • Nobody use Chipmunk physic here ? :/

  • You need to disable the collisions between the objects I think. The simplest way to do that is to make there collision group 1.

  • Okay this was clever, I wasn't. Indeed, it works ! But the thing still swinging now, like if someone just gave it a little push. Is there a way to make it immobile at the beginning ? Thanks for your answer anyway, it really helped me, as easy as it was x)

  • Here's a few ways to make a single-segment rope joint:

    https://dl.dropboxusercontent.com/u/523 ... oints.capx

    I think the slide joint with some kind of rotation damping on the lamp would be my preference - it give you an elastic cable, a bit more interesting than the stiff pivot joint.

  • It shouldn't swing if everything is centered around the fixed joint.

    Here's an example of one way to do it:

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

  • Thanks, they are perfect (both of your examples). Just a last thing about yours, R0j0hound. I noticed that your solution results sometimes by a Javascript error "the body is undefined". It's not a real problem because it doesn't concern the place I need to put this lampe, but I still can't figure out why it happens. Any idea ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mean my example causes that error? Or in your capx?

  • In my capx when I use the same technique than in your example

    I don't really understand why. It says "the body is undefined" as soon as I use a background (Tile map or Sprite).

    I tried on the same layout then in another one (wire and lampe on layout A, Background on layout B), the error still occurs

  • Posting your .capx will be the quickest way to getting an answer.

    If you aren't able to post this .capx - for whatever reason, e.g. NDA - can you recreate in a new one and post that?

  • Yeah I can't post the URL because I'm new, wow, rude (but understable because spams etc)

    Do I have to create a new topic ?

  • Yeah I can't post the URL because I'm new, wow, rude (but understable because spams etc)

    Do I have to create a new topic ?

    You can bypass the posting restrictions by inserting characters - asterisk, space etc - in the URL, e.g.

  • Rofl, I'm not a smart man. Sorry, of course I can, here's the capx :


    As you may notice, it's r0j0hound's example but with a background, which is a sprite on another layout.

  • I can't even tell which body is "undefined", everything is supposed to be defined already.

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