Yeah, I’ve been trying to make a snake game. You know snake as in the Nokia game, right? Well, so I’ve got this little dot movin by my keymoves across the screen, and smaller dots are randomized across the screen. When the two dots collide, 1+ points and a new randomized dot position. Now, i want the snake to grow one module when a dot is “eaten”. I have used
To create clone-modules named slave1, 2, 3 etc etc. Now, these only appears where they were created, how can i make them follow the master module in a line, as in the real game?
i think if you add this it should work, but i haven’t tried it and am not a masta flasher. it could hurt to try tho right? anywho, add this to the actions of the dot your cloning
<hr>
onClipEvent(load) {
num = _root.clone;
}
Thx for that. I can understand the thinking behind what you have written. There’s just one other thing that came to me, though, if
this._x = _root.snake._x;
and so on, wouldn’t that make the position of Slave1 the EXACT position of the original snake? I might be wrong, though, just a thought. I’m currently accessing this site from my school, however, so I havn’t tried it out yet, but I’ll give it a try. Thanx man!
But then, wont Slave1._x&_y always be snake._x&_y-20 and so on with Slave2 relative to Slave1 etc etc etc?
Then my snake will be leaning like a slashsign all the time nomatter what direction, right?
Cuz you know whent the snake moves to the right, for example, i want the Slave1 coordinates to be x: snake._x-20 y: snake._y
And so on, you follow? Then, a way to solve it could be:
on (keyPress “<Right>”) {
_root.move = “right”;
}
and
if (_root.move == “right”) {
coordinate conditions
}
Then i could set it to different coordinates on different directions, but we’d still have a problem: if I’m situated right next to the left border and press the right button all the slaves would be placed in a straight line directly, they wouldnt move there one by one
good question. like i said i haven’t gotten to really try anything like so…
have you tried it out? if so then post the .fla
if you have then i think the best solution would be to mess around with the whole “_root.move = ‘right’” and such. i really can’t figure an easy way out of this one. so just try different things and see what happens. if you get stuck post again and i’ll see what i can do.