How can I control a movieClip move randomly in the stage eve

  • ykc2007
  • Born
  • Born
  • No Avatar
  • Joined: May 25, 2007
  • Posts: 1
  • Status: Offline

Post May 25th, 2007, 2:05 am

Hi all,

I am having trouble on my Flash assignment which due on Monday, for the assignment, I am goingt to make a game, similar to the classic aracade game, Asteroids. They provided some basic code for the timing and rotation of asteroids, the behavior of the asteroids is appear randomly (but not moving) in the stage every five seconds with rotation, that's already been done by the code provided.

Now I need to modify the behavior of the asteroids so that when they appear, they:

spin in a random direction at random speed and size
move in random direction at random speed.
forced to appear along a screen edge

I feel really helpless, because programming is my weakness...
I hope someone can help me to solve this problems...

Thank you very much~~
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 25th, 2007, 2:05 am

  • zhaojany
  • Student
  • Student
  • User avatar
  • Joined: Aug 03, 2006
  • Posts: 78
  • Status: Offline

Post May 25th, 2007, 3:36 am

just one random() function can do it

you define the function with it to duplicate you asteroids,and another function to move them . you can define vars like speed and direction also you can use some Math method like Math.sin(),Math.cos() and so on so forth.

in your speed ,direction also some property of your asteroids use the random() function

its a outline,hope it helpful

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 63 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.