Archive for the ‘math / physics’ Category

AS3.0_数式(公式)のメモ

actionscript3.0のアニメーションで使う数式とかのメモ!!
※6/5にいろいろ修正! と 追加


(続きを読む…)

AS3_Math.random


◯ランダムについて

Math.floor(Math.random() * 2 + 1 );


の場合、
 
 

Math.floor();


で囲む事によって整数にする
 
 

Math.floor(Math.random() * 2 );


これだけだとtraceして出る数字が0と1になる
1と2で表示させるために
 
 

Math.floor(Math.random() * 2 + 1);


最後に +1 させている