Character Movement Question - Hug curved hills?

Discussion and feedback on Construct 2

Post » Sat Aug 01, 2015 6:38 pm

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.Image
B
3
S
1
Posts: 8
Reputation: 356

Post » Sat Aug 01, 2015 6:50 pm

Try doing it with physics. Look up examples.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Sat Aug 01, 2015 7:21 pm

megatronx wrote: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.
B
3
S
1
Posts: 8
Reputation: 356

Post » Sat Aug 01, 2015 7:30 pm

outtoplay wrote:
megatronx wrote: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
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Sat Aug 01, 2015 7:52 pm

Thanks for the input, Megatronx. Much appreciated.
B
3
S
1
Posts: 8
Reputation: 356

Post » Sat Aug 01, 2015 7:57 pm

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...
B
95
S
33
G
20
Posts: 438
Reputation: 17,640

Post » Sat Aug 01, 2015 8:41 pm

Message: outtoplay is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
AllanR wrote: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. 8-) Appreciate the input and help.

Best,
B.
B
3
S
1
Posts: 8
Reputation: 356

Post » Sun Aug 02, 2015 9:46 am

You could try this too.

behavior-sonic-physics_t150606
B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195

Post » Mon Aug 03, 2015 3:17 am

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.
ImageImage
B
119
S
23
G
7
Posts: 1,070
Reputation: 12,989

Post » Mon Aug 03, 2015 3:19 am

I implement this in my current project.

Image Image

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.
B
19
S
4
G
4
Posts: 67
Reputation: 3,181


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 32 guests