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

  • ykc2007
  • Born
  • Born
  • ykc2007
  • Posts: 1

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • zhaojany
  • Student
  • Student
  • User avatar
  • Posts: 79

Post 3+ Months Ago

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 11 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.