Character Movement Question - Hug curved hills?

0 favourites
  • 10 posts
From the Asset Store
Build your own scene with these beautiful custom sprites
  • Construct 2 seems like a terrific engine. This is also a wonderfully helpful and involved community. I have one question before I purchase.

    Here's my question. I want to make a side scroller game and the main character would 'slide or ski' along hills, maybe hit a slop and take air. I've not seen any examples of a 2d character 'hugging' the curves, what I mean is orienting to the curve he's following (see attached image). Is this type of motion, possible in Construct 2? I imagine it would be physics/force driven, but any input/insight would be greatly appreciated. Sort of like Tiny Wings in anyone remembers that game.

    best,

    Brendan G.

  • Try doing it with physics. Look up examples.

  • Try doing it with physics. Look up examples.

    Thanks for your note. So I gather this type motion is doable in C2? The question was as to whether it is doable in C2, not how(I love the r & d portion of projects). I looked through quite a few items in the arcade, and didn't notice any with character movement that oriented to slopes or angled surfaces. For instance, in Unity, I would create custom polygon colliders for a hilly 2d environment piece. C2 seems to use the Solid behavior, not sure if this conforms to curves. I am currently not working in C2 or plan to in the coming week or so. But it's on sale now, so if this is a known shortcoming, I imagined someone might confirm with a brief informed reply.

    best,

    B.

  • > Try doing it with physics. Look up examples.

    >

    Thanks for your note. So I gather this type motion is doable in C2? The question was as to whether it is doable in C2, not how(I love the r & d portion of projects). I looked through quite a few items in the arcade, and didn't notice any with character movement that oriented to slopes or angled surfaces. For instance, in Unity, I would create custom polygon colliders for a hilly 2d environment piece. C2 seems to use the Solid behavior, not sure if this conforms to curves. I am currently not working in C2 or plan to in the coming week or so. But it's on sale now, so if this is a known shortcoming, I imagined someone might confirm with a brief informed reply.

    best,

    B.

    Yes, C2 has collision mask you can use, but with physics its different i think. I never really used physics much, but I seen examples, and I'm 99% sure that creating sliding like that is doable. If you go to tutorials section and use search you might find some examples. Also all info about physics you will find in Manual. All best!! M

  • Thanks for the input, Megatronx. Much appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I helped someone with a very similar question over a year ago. Here is the capx of the sample level they were after:

    http://www.rieperts.com/games/forum/Wall-Tracing.capx

    not quite the same smooth curves you asked about, but close...

  • I helped someone with a very similar question over a year ago. Here is the capx of the sample level they were after:not quite the same smooth curves you asked about, but close...

    Thanks, Alan. I'll check this out after a short water battle in the sprinkler with my little guy. Appreciate the input and help.

    Best,

    B.

  • You could try this too.

  • Lots of great examples, you can also do it without physics by pinning a detector sprite under your character that compares the angle of the ground and then sets your player angle to match.

  • I implement this in my current project.

    As you can see the yellow boxes are the skeleton of the wall, where all collisions are checked. The crab's movement up and down the wall is controlled with sine movement. Every tick I check if a certain point on the crab (between the legs, just below the body) is touching the wall, if not move the crab left until it's touching. On the other hand, if it's overlapping the wall too far, push the crab out to the right.

    Then, once the crab is along the surface, check the angle of the yellow box the crab is touching, and set the crab's angle to be the same.

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