Sterny101
08-07-2005, 09:32 AM
Hi. i am fairly new to 3dfa and javascript and i would like some help with a game i am creating. the game consists of targets that when are shot will blow up. what i would like to do is have an animated target that will clone and fly accross the screen every few seconds at a rondom y position. i have written this in the starting script which clones the target "Bird3" 15 times.
myBird = element ("Bird3")
Bird3_array = new Array (15)
for (n=0; n<Bird3_array.length; n++){
Bird3_array[n] = myBird.clone ()
Bird3_array[n].y = random
Bird3_array[n].show()
}
i have come accross a few probelms with this.
1. i have written random becuase i do not know the correct script to make the element appear at a random y position. i have tried a few scripts i have found on this forum to make elements appear at random position however none of these work
2. i would like to know how to make each of the clones appear at intervals and not all at the same time
3. if possible i would also like to make it so that these cloned elements will appear at random intervals of either 1,2 or 3 seconds
thanks in advance for your help
Sterny
myBird = element ("Bird3")
Bird3_array = new Array (15)
for (n=0; n<Bird3_array.length; n++){
Bird3_array[n] = myBird.clone ()
Bird3_array[n].y = random
Bird3_array[n].show()
}
i have come accross a few probelms with this.
1. i have written random becuase i do not know the correct script to make the element appear at a random y position. i have tried a few scripts i have found on this forum to make elements appear at random position however none of these work
2. i would like to know how to make each of the clones appear at intervals and not all at the same time
3. if possible i would also like to make it so that these cloned elements will appear at random intervals of either 1,2 or 3 seconds
thanks in advance for your help
Sterny