Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-21-2004, 10:05 PM   #1
Registered User
Join Date: Oct 2004
Posts: 4
Question trying to make astroids move down the screen in random places

i am trying to make movieclips come down the screen. I am making an astroids game, here is the code...

onClipEvent (load) {
	speedastroid = 2;
onClipEvent (enterFrame) {
	this._y += speedastroid;
	count = 1;
	while (count<2) {
		_root.astroid.duplicateMovieClip("astroids"+count, count);
		_root["astroids"+count]._x = random(650);
		_root["astroids"+count]._y += speedastroid;
		count += 1;
	if (this._y>500) {
so the astroid moves down the screen, but the random x corrdinate gets reset, so the astroid come down the screen and moves in differ places on the x axis. I want just one random number per astroid, i don;t want it getting reset on each frame.

can u plz help me

here is the link to see what i mean with the astroids.
click on play game, u have to wait like 10 seconds for the astroids to start coming down. Also the laser doesn't work ever since i added the astroids, but its works in the instructions.

anthony88guy is offline   Reply With Quote
Old 10-21-2004, 11:21 PM   #2
Join Date: Aug 2004
Location: San Diego, CA
Posts: 1,774

don't use onEnterFrame then cause that will change it every frame.
Gibberish is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:09 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.