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

0 favourites
  • 7 posts
From the Asset Store
25 high quality isometric ground blocks + sprite sheet
  • 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!

  • 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.

  • 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

  • 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.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • DuckfaceNinja Alright I see!! I'll revisit this project after a few others then, thank you!

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