Worm game

Does somebody have a code for worm or snake game.
Please sent it to : [email protected]
:-\

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

Is it really that complicated?

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.

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 :stuck_out_tongue:

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

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…

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/
Worm Game now for two players too.
:slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:

glad i could help…:slight_smile:

Wow! Nice job, man!

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.

http://www.inet.hr/~tstefan/worm/
Worm Game now for two players too.
Let’s eat those apples.
:slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: