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
if you want it to wait a couple of seconds before the next one comes out go under "events" and select delay time and you can work with that. If you want a traget to come after the first target is destroyed therer are many options to do that. I;m kinda busy so I dont have time to explain. tell me if this helps at all.
thank you for your help. i have tried this however when i start the game it comes up with an error saying that randomRange has not been found. am i right in saying that beers[y] should be replaced by the name of my element?
oh sorry i was busy when i was writting this but here look at this game that I got that from, it should help. Youll need to replace some of the pictures first thogh. Like it will say that the beers are missing so just go into the 3dfa animator libray and find the beer icon, do as need thoughout the game. Just look at the main code and starting script for answers. I tried making so the beers would go left to right instead of up to down but i had problems, maby you can fix it.