登录可保存游戏进度并赚积分!
How to make a randomnumber in flash AS2

How to make a randomnumber in flash AS2

开发者 symiily

Loading ad...

How to make a randomnumber in flash AS2

评分:
2.2
上架时间: February 04, 2010
最近更新: February 04, 2010
开发者: symiily

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!).

评论

0/1000
HerrSerker avatar

HerrSerker

Feb. 10, 2010

0
0

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 avatar

wertyujh

Feb. 04, 2010

0
0

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 avatar

Alonski

Feb. 04, 2010

0
0

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 avatar

Carr77

Feb. 04, 2010

0
0

aaaand what can i do whit this?