Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-16-2001, 10:56 AM   #1
idle65
Registered User
 
Join Date: May 2001
Posts: 33
Exclamation

I have a basic space shooter as created from a tutorial on flashkit. The same enemy is randomly duplictated over and over again. Is there some code that will allow me to stop this duplication?
The code on the enemy is
onClipEvent (load) {
function reset () {
this._x = 600;
this._y = random(100)+50;
enemySpeed = random(4)+1;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
if (_root.spaceship.scrollStart) {
this._x -= enemySpeed+_root.mainGround.groundSpeed;
} else {
this._x -= enemySpeed;
}
if (this._x<-10) {
reset();
}
if (this.hitTest(_root.spaceship)) {
_root.gotoAndStop("gameOver");
}
}
Thanks
Dave
idle65 is offline   Reply With Quote
Old 06-16-2001, 11:47 AM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

that code doesn't control the duplication... you'll have to edit the code which does... please use [ code ] and [ /code ] tags for forum neatness when possible.
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 06-16-2001, 12:39 PM   #3
idle65
Registered User
 
Join Date: May 2001
Posts: 33
Default

sorry i think this may be it. It is contained on the first frame of the main timeline
Code:
numEnemy=3;

for (i=2; i<=numEnemy; i++){
        enemy1.duplicateMovieClip( "enemy"+i, i+100 );

}
idle65 is offline   Reply With Quote
Old 06-16-2001, 12:46 PM   #4
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

yeah that's the duplicate code but it only makes 1 (or maybe 2) duplicate(s)... if more are being made there must be more script which is looping back to that frame...
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 06-16-2001, 12:56 PM   #5
idle65
Registered User
 
Join Date: May 2001
Posts: 33
Default

this code is what duplicates and loops the movie clip i followed it from a tutorial at

http://www.flashkit.com/tutorials/Ga...11/more4.shtml

thanks
dave
idle65 is offline   Reply With Quote
Old 06-16-2001, 03:48 PM   #6
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default strange request

I'm going to bed now and in them orning I only answer new threads since I last looked, do me a favour and reply this thread so it's considerred new when I wake up
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 06-16-2001, 03:51 PM   #7
idle65
Registered User
 
Join Date: May 2001
Posts: 33
Default

k
idle65 is offline   Reply With Quote
Old 06-16-2001, 07:35 PM   #8
idle65
Registered User
 
Join Date: May 2001
Posts: 33
Exclamation

i have worked out i need some way to stop this duplicating happening but how?
idle65 is offline   Reply With Quote
Old 06-17-2001, 12:41 PM   #9
sky_doq
Registered User
 
Join Date: Dec 2000
Location: Brielle , the Netherlands
Posts: 65
Send a message via AIM to sky_doq Send a message via Yahoo to sky_doq
Red face

Did you already considered a Stop action after the loop ?

if not stop, then make it with a variable which loops it once, then set the variable to another number and then it stops looping.

like this: ( not in actionscript, but the wat it should be )

if myvar = 0

loop the duplicate action, then set myvar to 1 and it should stop

bye

JJ
sky_doq is offline   Reply With Quote
Old 06-17-2001, 12:44 PM   #10
idle65
Registered User
 
Join Date: May 2001
Posts: 33
Default

thanks for all your help i have now fixed my problems
idle65 is offline   Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Card Match Game, Colour Me In Pictures and Board Game Total Frigging ActionScript 2.0 4 02-21-2005 01:04 AM
word search game with AS2 black General Chat 5 08-12-2004 10:44 AM
[AS2] Tile game or not tile game? krolben Gaming and Game Development 4 07-28-2004 01:41 PM
Game - freelancer required fatherb Projects and Positions 6 07-18-2003 12:47 PM


All times are GMT. The time now is 07:24 AM.


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