Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I don't want code or anything that will make this too easy for me, but I'm just starting the development of a little game and I want to add worms to it, I want the worms to be Terraria like. My current idea is to make the worm be composed of multiple entities, one being the head and the rest parenting each other leading downwards from the head. However, this in my opinion sounds inefficient and might be lag inducing when there are a large number of worms in the entity map. Does anyone have any other theories on how I can implement a worm- like movement?

Terraria worm video: http://www.youtube.com/watch?v=PhFR8bDQA5w

share|improve this question
3  
possible duplicate of How To Approach 360 Degree Snake –  Byte56 Mar 22 '13 at 20:34
add comment

1 Answer

Well you aren't quite far from the famous approach for Snake like games. Let the worm be represented as an array of segments. Head being the 0 element of array. Head should controll the movement of the body while each segment would follow its predecessor.

share|improve this answer
    
This is answered in the duplicate already. –  Byte56 Mar 22 '13 at 22:07
    
Oh :) Well I didn't know. –  Aron Boguta Mar 22 '13 at 22:09
    
No worries, you can check the comments below the question for information about closing before answering, just so we don't have any wasted effort. –  Byte56 Mar 22 '13 at 22:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.