# Worm game

**URL:** https://forum.kirupa.com/t/worm-game/7168
**Category:** Uncategorized
**Created:** [October 24, 2002, 10:58pm UTC](https://forum.kirupa.com/t/worm-game/7168 "2002-10-24T22:58:51Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![tstefan](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tstefan](https://forum.kirupa.com/u/tstefan)
#### Post date: [October 24, 2002, 10:58pm UTC](https://forum.kirupa.com/t/worm-game/7168/1 "2002-10-24T22:58:51Z")

</div>

Does somebody have a code for worm or snake game.  
Please sent it to : [t0mc4thr@yahoo.com](mailto:t0mc4thr@yahoo.com)  
:-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 25, 2002, 4:40am UTC](https://forum.kirupa.com/t/worm-game/7168/2 "2002-10-25T04:40:44Z")

</div>

do you mean a game like the Tron laser bike game? I think the origional was called blockade?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 25, 2002, 6:37am UTC](https://forum.kirupa.com/t/worm-game/7168/3 "2002-10-25T06:37:42Z")

</div>

[Is it really that complicated?](http://kirupaforum.com/showthread.php?s=&threadid=7457)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 25, 2002, 6:42am UTC](https://forum.kirupa.com/t/worm-game/7168/4 "2002-10-25T06:42:18Z")

</div>

It could be. Lets see you’d need at least the following

attach movie clip, hit detection, and keyboard interaction methods.

I guess for a first year Flasher that might be tough.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 25, 2002, 6:54am UTC](https://forum.kirupa.com/t/worm-game/7168/5 "2002-10-25T06:54:43Z")

</div>

No Upu, I meant: is it really that complicated to read the thread called “Please read before posting” and write which version of Flash you’re running.

Of course, the game in itself is complicated…

pom 😛

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 25, 2002, 7:31am UTC](https://forum.kirupa.com/t/worm-game/7168/6 "2002-10-25T07:31:31Z")

</div>

lol… sorry. didn’t know what you meant.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 25, 2002, 6:23pm UTC](https://forum.kirupa.com/t/worm-game/7168/7 "2002-10-25T18:23:30Z")

</div>

well im not too hot on using arrays and stuff in flash… i use them all the time n c++… but i suppose you could have 1 movie clip… and record its x and y position in an array on enter frame… and then apply that to the next movie clip in the “snake” so it will follow the path… im not exactly sure about tackling this… but ive seen it used before in mouse followers… and i know depending on the size of the array it adjusts the delay of it following… im sure one of the smart people here can do this in there sleep… lol i wish i could…

oh yeah and about continuous movement in a direction which im assuming you will need… i did it once… on accident… i was messin with the if(Key.isDown) thing… and it just kept goin in one direction… forget how to do it exactly though… but i think this is what you mean anyway by the worm game…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 30, 2002, 8:35pm UTC](https://forum.kirupa.com/t/worm-game/7168/8 "2002-10-30T20:35:52Z")

</div>

I would like to thank sootman for the array hint.  
This is what has come out, it is not finished yet but test it anyway.

[http://www.inet.hr/~tstefan/worm/](http://www.inet.hr/~tstefan/worm/)  
Worm Game now for two players too.  
🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 30, 2002, 11:47pm UTC](https://forum.kirupa.com/t/worm-game/7168/9 "2002-10-30T23:47:54Z")

</div>

glad i could help…🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 31, 2002, 3:15am UTC](https://forum.kirupa.com/t/worm-game/7168/10 "2002-10-31T03:15:49Z")

</div>

Wow! Nice job, man!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [October 31, 2002, 7:42am UTC](https://forum.kirupa.com/t/worm-game/7168/11 "2002-10-31T07:42:58Z")

</div>

This is the code that calculates the moovement of the worm:

i = 1;

oldx[0] = \_root.master.\_x;  
oldy[0] = \_root.master.\_y;  
master.\_x += speedx;  
master.\_y += speedy;  
while (i\<=myLength) {  
oldx[0]= myTrails\*.\_x;  
myTrails\*.\_x += (oldx[i-1]-oldx\*)/1.5;  
oldy[0]= myTrails\*.\_y;  
myTrails\*.\_y += (oldy[i-1]-oldy\*)/1.5;

i = i+1;  
}

Master is the movie clip which is followed.  
-myTrails is array with duplicated master clips.  
-oldx and oldy are arrays in witch old movie clip positions are recorded and than assigned to a new clip.  
If you putt \_xmouse and \_ymouse instead speedx and speedx you will get nice mouse follower.  
Try it.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 1, 2002, 2:24pm UTC](https://forum.kirupa.com/t/worm-game/7168/12 "2002-11-01T14:24:40Z")

</div>

[http://www.inet.hr/~tstefan/worm/](http://www.inet.hr/~tstefan/worm/)  
Worm Game now for two players too.  
Let’s eat those apples.  
🙂 🙂 🙂 🙂 🙂 🙂 🙂 🙂
