The Daily Click ::. Forums ::. Klik Coding Help ::. Worm type creature
 

Post Reply  Post Oekaki 
 

Posted By Message

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
2nd January, 2005 at 12:01:36 -

Hiya again everyone. It's been a while. Anyway I need to ask you guys how you would do this, because I'm a little stumped on this one.

You remember in the old 2D games where they'd have a worm-like creature whose body was made up of spheres, one sphere/sprite was his head, and a bunch of separate sprites of the same thing went together to make up it's body, and then another for the tail, you know what I mean? Almost like the spheres are joined together as a chain. The 'head' would move around, and the body would follow it, connected to it, creating a nice effect as it would change shape as it turned around and such.

I'm going to be attempting to create one of these creatures, and I'm pretty sure I can do it, but I am a little confused at the moment and haven't yet come up with any ideas of how to do it. So I'd appreciate a few little pointers or notes, or even an explanation of how one of you would do it yourself, you know? You could make a cca file if you wanted to, but I'd enjoy a written explanation too as I like to be able to interpret things.

I am using MMF 1.5

 
http://www.fzgames.com

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
2nd January, 2005 at 12:40:45 -

I'm sure there are quite a few examples of that on Clickteam's MMF file archive, and some of them work pretty well.
http://www.clickteam.com/CTforum/postlist.php3?Cat=&Board=upload Do a search for 'Snake engines'

 
Image

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
2nd January, 2005 at 12:48:56 -

Not exactly what I was looking for but thanks anyway. I've had a couple of ideas so I'll try some out later and if it works I'll post it up somewhere.

 
http://www.fzgames.com

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
2nd January, 2005 at 19:55:34 -

It is very simple and there are some good examples at this site, search for 'snake' in the DC search.

 
n/a

Rick (AntiMatter Entertainment)

Possible psychotic

Registered
  18/10/2002
Points
  814

VIP Member360 OwnerWii Owner
3rd January, 2005 at 02:31:39 -

You need seperate objects for each "section". Basically, the "sections" on the end are the only ones that actually have a movement, ie. the head and tail. The others have their Y and X positions set to the average of the ones they're in between.

This method sucks for certain things but it's the easiest. Don't expect to get a natural "wriggling" movement from this one though, unless you make every other section move and the others set positions.

For example, section 4 has the following event:

CONDITIONS:

Always;
EVENT:
+ Set X position of "section 4" to ((X pos of "section 3")+(X pos of "section 5"))/2
+ Set Y position of "section 4" to ((Y pos of "section 3")+(Y pos of "section 5"))/2


Image Edited by the Author.

 

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
3rd January, 2005 at 03:42:26 -

Snake Rattle and Roll!
That was the kewest!

Um, how to do it?
I'd need a shovel...

Headach with pictures...

Try giving each bodypart it's own interia in retrospect to the piece infront of it.
(Just a thought)





CONDITION

Always:

(head) --> Intera (ypos head = ypos head + value a) .ect

(Body part 2) --> Set x position to ((x pos of "head")+Value A("body part 2")
(Body part 2) --> Set y position to ((y pos of "head")+Value b("body part 2")

// This places the second body part in the same position as the first, but with displacement FROM it.

(body part 2) --> Add Value c of ("body part 2") to value A of ("body part 2")
(body part 2) --> Add Value d of ("body part 2") to value B of ("body part 2")

// This is the interia of the body part two from the first.

If you continue this in a chain, than put simply...

The head will be the leader.
Body part two's interia will equal it's own interia plus the head's interia.
Body part three's interia will equal it's own interia plus the head's interia and the interia of body part two.
Body part four's interia will equal it's own interia plus the head's interia, the interia of body part two and three.

And so on...

Need more explaining?


CONDITION
Always:

(Body part 3) --> Set x position to ((x pos of "body part 2")+Value A("body part 3")
(Body part 3) --> Set y position to ((y pos of "body part 2")+Value b("body part 3")
(body part 3) --> Add Value c of ("body part 3") to value A of ("body part 3")
(body part 3) --> Add Value d of ("body part 3") to value B of ("body part 3")


// You would need to fiddle around with the interia of the linked bits to get it to actually "wriggle".




Ummm... how about,
Always : (Body part 2) --> set X interia of ("body part 2")(ie. value C ) to ( zero - ((head's X interia value) /2))
(take away half of the heads interia so that it trails away)








 
n/a

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
3rd January, 2005 at 12:45:35 -

I made something like that. I used it as a tail of a monster (the 1st boss of Deadly Swords 2) rather than a worm.
Want it?

 
This space is for rent

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
7th January, 2005 at 07:01:12 -

Umm, woops... My bad. I hope you didn't try what I said.
Without a whole lots of extra events, what I said will not work.

I just post what I have done in the downloads section.
Look for Wriggling Snake engine. I hope it helps!

 
n/a

Matt Boothman

The Nissan Micra of forum members

Registered
  20/09/2002
Points
  109

Game of the Week Winner
7th January, 2005 at 15:09:43 -

What the hell does interia mean?

 
http://soundcloud.com/normbo - Listen to my music.

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
7th January, 2005 at 15:21:31 -

I think it's like the opposite of 'exteria'

 
Image

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
8th January, 2005 at 03:20:25 -

I'm making a mouse-controlled snake game... his head keeps falling off .

 
n/a

Long John Kickbag



Registered
  26/08/2002
Points
  148
8th January, 2005 at 20:17:39 -

You could cubically interpolate the middle point between the head and the tail (www.clicksplat.com/Files/Extensions/Click/Interpolation.zip ).

 
Resize! - www.clicksplat.com/comparison.html

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
16th January, 2005 at 07:03:57 -

I think interia is inertia. Dunno what it means, though.
Finally people begin to clone games other than tetris or breakout .

 
Old member (~2004-2007).

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
16th January, 2005 at 08:36:44 -

Inertia: the tendency of an object to travel at the same velocity unless acted upon by outside objects(friction, gravity, walls, etc).

 
n/a

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
23rd January, 2005 at 11:38:06 -

Well in Clickteam products the word Interia is used to talk about X/Y movement of an object, as simple as that. You guys should know that if you've used the tutorials.

Thanks for your little bit of info there, 'Dr Evil Face', it was helpful, I'll try your demo out. The closest I had before was using a bouncing ball movement, but I didn't really want to use MMF's pre-built movements due to limitations. My strategy was to get all of the objects to "follow" the head object

"Snake Rattle and Roll! That was the kewest!" I agree! One of the first games I ever owned.

 
http://www.fzgames.com
   

Post Reply



 



Advertisement

Worth A Click