How do I have blocks spawn and follow my "snake?"

Get help using Construct 2

Post » Mon Oct 13, 2014 5:20 am

I'm making a snake game where the head is a character, and the tail is going to be individual pieces. I'm having trouble thinking of a way to get the tail blocks to spawn and start following the leader in his exact path.

My leader is a bullet and I used the keyboard key presses to change his angle giving it the snake movement feel. I tried the pin chain bar style and they didn't follow in the exact path, they curved when the leader turned. I'm also not sure how to tell them to spawn behind him/behind each other!
B
10
Posts: 28
Reputation: 401

Post » Mon Oct 13, 2014 5:37 am

The traditional snake game can be done through spawn tail - destroy oldest instance. However the sprite will not move just like this example.
If you want the tail somehow stays and follow the head, you need to record the head's waypoint, so that the individual body piece will follow that path.
B
28
S
8
G
4
Posts: 553
Reputation: 4,914

Post » Mon Oct 13, 2014 5:48 am

@DuckfaceNinja
Sorry, I'm a little confused about what you're talking about! (I'm a total novice at Construct.) How do I do the spawn tail - destroy oldest instance? I searched the manual for that but it came up with no results!

(and just to clarify I'm wanting it to follow rigidly like in this game:)

edit: okay I guess I can't post links yet;; if you google "digisnake" it's the first and second link though
B
10
Posts: 28
Reputation: 401

Post » Mon Oct 13, 2014 6:02 am

What I see from digisnake is you need to know how to use array and tilemap (or tilebackground will work too). However, to manipulate the array that way would be a bit of undertaking there since you're a novice. Even though it seems like a very simple game, this is actually falls into intermediate level, which I recommend to learn something more basic first.
B
28
S
8
G
4
Posts: 553
Reputation: 4,914

Post » Mon Oct 13, 2014 3:05 pm

@DuckfaceNinja Ah I see, so there's no way to do it without the array then? ): Dang, alright. Thanks for all your help!!
B
10
Posts: 28
Reputation: 401

Post » Mon Oct 13, 2014 3:57 pm

misterkoala wrote:@DuckfaceNinja Ah I see, so there's no way to do it without the array then? ): Dang, alright. Thanks for all your help!!

There's many way to do it actually, it just that I don't think any of other method is any easier, for example you can use instance variable and timer, but it's actually quite tricky and requires you to know much more. Well I'm mentioning array for the reason of it's usefulness in any situation. For me, array is the most robust functionality that let you to make almost anything, so learning array is much more future proof.
B
28
S
8
G
4
Posts: 553
Reputation: 4,914

Post » Mon Oct 13, 2014 4:51 pm

@DuckfaceNinja Alright I see!! I'll revisit this project after a few others then, thank you!
B
10
Posts: 28
Reputation: 401


Return to How do I....?

Who is online

Users browsing this forum: adamebastin, plinkie and 9 guests