View Single Post

#1
Bookmark and Share!
gaussian / weighted random distribution
Old 2009-01-09

Hi all.

I'm trying to create a weighted random distribution, and can't figure out how to go about it. basically I want to create a starry sky, where most of the stars are in the middle of the screen. by making the y random, like:

Code:
star.y =Math.random()*_mc.stage.stageHeight;
I just get an even distribution on the Y axis. What I really want is to have most of the stars near _mc.stage.stageHeight/2.

Anyone has a good idea of how to accomplish?

thanks!
::| ITAI |::
postbit arrow 2 comments | 577 views postbit arrow Reply: with Quote   
iasseo
Registered User
iasseo is offline
seperator
Posts: 120
2003-02-21
seperator

Ultrashock Member Comments: