How do I make a "snake" like movment

Get help using Construct 2

Post » Sat Apr 19, 2014 2:32 pm

Im trying to make a game that is very similar to the classic snake game, but i couldn't manage to make the same line effect that they did (i mean like the tail move like the "head" of the snake in delay). someone has ideas to do that?
B
3
S
1
Posts: 5
Reputation: 780

Post » Sat Apr 19, 2014 2:39 pm

This might be useful if your snake is comprised of a bunch of sprites:

https://www.scirra.com/manual/99/pin

"Rope style: the object is not rotated, but is kept at a maximum distance from the other object."
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Post » Sat Apr 19, 2014 3:23 pm

Hmm thanks for the reply though i did EveryTick Pin in rope style and it did nothing.
i also tried the other styles
B
3
S
1
Posts: 5
Reputation: 780

Post » Sun Apr 20, 2014 1:27 am

Perhaps a separate issue? :)
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Post » Sun Apr 20, 2014 2:02 am

If you don't mind having a blocky effect (old-shcool style) then you could use an array for this. The array stores the coordinates for each element of the snake - the head writes its coordinates to the front and the other segments of the snake read their positions from it. When the head moves, just push in its new coords so each of the subsequent elements will have their position coords changed to those of its more senior neighbor.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Sun Apr 20, 2014 10:46 am

Here's a very dodgy quick example.

https://www.scirra.com/tutorials/977/snake-game
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Sun Apr 20, 2014 7:00 pm

Thanks that really helped!
B
3
S
1
Posts: 5
Reputation: 780

Post » Sat Nov 26, 2016 11:29 am

@AdamAlyagon. Thanks for asking the question. The replies have helped me too. Thanks to the C2 communnity too.
B
21
S
14
G
15
Posts: 14
Reputation: 16,243


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests