How do I Make A Moving Snake

  • Hey all, I have a question that Im not sure even how to word. Do you know how in games a snake would be represented as balls or separate pieces to make it move? How is that done? How would that be done in C2?

    Thank you for looking.

  • In a traditional snake game, the segments of the snake actually don't move at all. The "head" piece leaves "body" segments behind as it moves, and the duration the "body" segment exists for determines the length of the snake.

    Otherwise, you'll want to look into using waypoints system with an array.

  • For clarification, Im not making a Snake game. Im trying to make a snake like object like youd find in a Contra or Metal Slug game. Sometimes its an actual snake, often its an arm or something.

    I got it to work by using the Pin behavior - If 3 segments made the snake as C (tail) B (body) A (head), Pin C to B and Pin B to A and give A directional behavior to "drive" the body segments (B,C)

    Now, Im at a loss on how to pin the same segments of the body together, for example; C,B,B,B,A Any ideas?

    Thanks

  • Ah... not sure then. I believe there are some Pin examples when you go to "New Project" in the menu.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can add number,x,y variables (3 variables). You move head only. Each tick you set x and y as actual position of snake parts then you move each snake part to position of previous one.

    And use number value to knew order of peaces

  • Now I feel like an idiot. Turns out just pinning a segment makes all segments of that type fall in line. Exactly like the pin/rope example I didnt bother to look at first. Sorry to waste your time.

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