チェンジセット 961: as3/SMSas

差分発生行の前後
無視リスト:
コミット日時:
2008/08/11 23:22:02 (3 年前)
コミッタ:
ll_koba_ll
ログメッセージ:

add randumRange

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/SMSas/sample/sample04/Sample04.as

    r903 r961  
    2828                switch (e.keyCode) 
    2929                { 
    30                     case 70: // f 
     30                    case 70: // f                         
    3131                        if (stage.displayState == "normal") stage.displayState = "fullScreen"; 
    3232                        break; 
     
    128128                { 
    129129                    var p = particles[i]; 
    130                     /* 
    131                     p.y = mouseY + p.by + MathUtil.rangeRandom(10,-10); 
    132                     p.x = mouseX + p.bx + MathUtil.rangeRandom(10,-10); 
    133                     /*/ 
    134                     p.y = point.y + p.by + MathUtil.rangeRandom(10,-10); 
    135                     p.x = point.x + p.bx + MathUtil.rangeRandom(10,-10); 
    136                     //*/ 
     130                    p.y = point.y + p.by + rangeRandom(10,-10); 
     131                    p.x = point.x + p.bx + rangeRandom(10,-10); 
    137132                    p.cx = WIDTH - p.x; 
    138133                    p.cy = HEIGHT - p.y 
     
    149144 
    150145        } 
     146 
     147        private function rangeRandom(max:Number, min:Number):Number { 
     148            return Math.floor(Math.random()*(max-min+1))+min;             
     149        } 
     150         
    151151         
    152152    }