How do I create snake-like movement?

Get help using Construct 2

Post » Wed Jul 11, 2012 3:54 am

How do I create an snake like enemy similar to this?

Also, I want to create something similar to the options from Gradius, but I don't know how to make the options follow the path the player is moving.

(Here's a video of Gradius V. The options are the small orange things following the player. Notice the way they follow the player.)
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Wed Jul 11, 2012 4:10 am

There is a slick 'PIN' behavior using the 'rope style' demo in the Construct 2 Demos... perhaps check that out?

GL!

-Remy
B
56
S
13
G
1
Posts: 151
Reputation: 4,499

Post » Wed Jul 11, 2012 4:28 am

Not entirelly the same as the video since the behavior doesn't work exactly like that one but here it is: Snake Example
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Wed Jul 11, 2012 4:38 am

Sorry, but it wasn't quite what I looking for.

I want to have it so that when the player moves, the objects following him must follow the same path the player moved.

For example, if the player moves in a circle or in random directions, the options must strictly follow the exact path he went in.
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Wed Jul 11, 2012 4:40 am

That's what i said it's not exactly like the video. The video is "follow the next" style. I'm not exactly sure how to replicate that. With pin behavior is probably impossible right now.Kiyoshi2012-07-11 04:41:01
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Wed Jul 11, 2012 4:42 am

Sorry, I was writing my reply just when you posted yours. :P
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Wed Jul 11, 2012 4:59 am

I tried to replicate it but it would require to C2 support something like

Always
Foreach Body Ordered
   Pick Body with number 0 : lerp to header
   Pick Body with number 1 : lerp to body with number 0
   Pick Body with number 2 : lerp to body with number 1
   ....

Or have i missed something ?
Kiyoshi2012-07-11 04:59:32
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Wed Jul 11, 2012 4:40 pm

doin it smoothly would be hard in c2 but the actual following isnt. You give each part an instance var with the id of the part it follows. After the main part moves then you loop thru following parts and set its location to where the part its following just was
B
13
S
5
G
2
Posts: 306
Reputation: 3,262


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], jul and 18 guests