Looping Background and random "stuff" flying by

Well, I’m making a game called Dodge the Nukes. You’re in a plane and you move it left and right trying to dodge the nukes. I have most of the game pretty well done. The movement, scoring, made it so when you hit a nuke you die etc… I’m fairly new to flash so I’m just trying to create a basic game like that. The only problem is tha I don’t know who to make it so the nukes will fly by every time in random spots and that they will increase speed as the score gets higher. I also want clouds to fly the opposite way in the background so it looks like you’re actually in the sky. I’ve read some tutorials and tried them but alot of them seem glitchy and it won’t loop correctly. So I was wondering if someone could help out.

–ABC123

Err, Bump Please reply. This is the fourth forum I have gone to and no one will reply!

–ABC123

Heres some help. You say you want the nukes to speed up as the score increases, well, you can simply place an empty movie clip on the stage and add some script to it that checks to see what the score is and takes action apropriatly. Firstly set the starting speed of the Nukes.

var nukeSpeed:Number = Number(“10”);

since you mentioned you are new ill explain this. This line of script creates a variable named nukeSpeed and assines it the value of 10.

In the empty movie clip you created to check the score place something along these lines on it

onClipEvent(enterFrame){
** if(score >= 100){**
** var nukeSpeed:Number = Number(“20”);**
** }**
}

This line of script does a couple of things. Firstly don’t be daunted by the “onClipEvent(enterFrame)” bit this just means “when this movie clip is reached, do this…”. The second line is to check the current score. To handlers are used the “>” and “=” these mena bigger than and equal to, thus if the score variable bigger than or equal to 100 the below action is taken which changes the speed of the nukes. Easy!

Thanks, do you know any way how I can get nukes to continually fly by but each one in a different place so that theey just don’t fly by in one straight line?

–ABC123

Please don’t ban me for doing this. Went to another 4 forums and posted this. People just don’t look at it!

–ABC123