Charas-Project

Off-Topic => Really Old Stuff => Archive => General programming => Topic started by: Azure_Jahk on February 25, 2006, 10:40:37 PM

Title: Flash MX2004 help (random duplication)
Post by: Azure_Jahk on February 25, 2006, 10:40:37 PM
Im making a simple game in flash, Ive made a character using the character generator, imported it, traced it, animated it, wrote the code etc. so it will walk around on key commands (heres a link if you wanna see it http://h1.ripway.com/ssaiyanx2/Jahk.swf (you will have to click on screen, shift toggles the wings on and off)). I am ok when it comes toa hittest, e.g. with an enemy and I have already made a healthbar in a different game that decreases when in contact with an enemy,

What I need help with is a code to duplicate a movieclip with a new name in a random location, The code I am currently using is this;

nmec+=1
_root.enemy.duplicateMovieClip("enemyx"+nmec,1)
_root["enemyx"+nmec]._x=random(550)
_root["enemyx"+nmec]._y=random(400)

this is okay for the first 2 enemies but is glitchy afterwards, also when shown in a web browser the script causes the computer to run slow and has to be aborted(http://h1.ripway.com/ssaiyanx2/continuum.swf)