Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • General programming »
  • Flash MX2004 help (random duplication)
« previous next »
  • Print
Pages: [1]

Author Topic: Flash MX2004 help (random duplication)  (Read 2610 times)

Offline Azure_Jahk

  • Member
  • Initiate
  • *
  • Posts: 1
  • flash guy
Flash MX2004 help (random duplication)
« 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)
Logged

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • General programming »
  • Flash MX2004 help (random duplication)
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum