左右で円の色を変える
ランダムに円を配置するさい,左半分は赤,右半分は青に色分けします.
♥0 |
Line 23 |
Modified 2010-10-11 16:25:50 |
MIT License
archived:2017-03-10 08:16:22
ActionScript3 source code
/**
* Copyright shmdmoto ( http://wonderfl.net/user/shmdmoto )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/w7r2
*/
package
{
import frocessing.display.F5MovieClip2D;
/**
* 円を左半分は赤色に右半分は青色にランダムに配置する
* @author shmdmoto
*/
public class GraphicExample extends F5MovieClip2D
{
public function setup() : void
{
var i:int;
var x:Number;
var y:Number;
for( i = 1 ; i <=1000 ; i++ ) {
x = random( 465 );
y = random( 465 );
if( x < 465 / 2) {
fill(255,0,0);
} else {
fill(0, 0, 255);
}
ellipse( x, y, 20, 20);
}
}
}
}