How to make a randomnumber in flash AS2
开发者 symiily
How to make a randomnumber in flash AS2
How to make a randomnumber in flash AS2 的标签
简介
Here is a tut about how to make a random number in flash
玩法说明
Use the mouse to move(suprise!).
评论
HerrSerker
Feb. 10, 2010
Just a tut with NO explanations how to alter to settle for your needs heres how
if you want a numer that is in the range from say 1 to 6 you need Math.floor(Math.random()*6+1). If you need numbers from placeholders a through to b try this: Math.floor(Math.random() * (b-a+1) + a), e.g. from -5 to +5 , so a equals -5 and b equals +5: Math.floor(Math.random()*(+5-(-5)+1)+(-5)) this is Math.floor(Math.random()*11-5). Should be correct, sue me if not
wertyujh
Feb. 04, 2010
yeah, it is. Math.random() generates a random number between 0 and 1. like 0,5332232
so, i would say, on(release)
{
random = Math.random()*10 + 1
Alonski
Feb. 04, 2010
This is pretty bad looking sorry to say. Should look nicer. People like nice graphics... Also isn't there a random number generator in flash? Math.random() anyone?
Carr77
Feb. 04, 2010
aaaand what can i do whit this?