flash on 2010-2-6
♥0 |
Line 28 |
Modified 2010-02-07 00:50:22 |
MIT License
archived:2017-03-20 00:42:01
ActionScript3 source code
/**
* Copyright 084 ( http://wonderfl.net/user/084 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7wAV
*/
package {
import flash.display.Sprite;
public class Main extends Sprite {
private var star:Sprite;
private var hankei:Number = 50;
private var hankei2:Number;
public function Main():void {
star = new Sprite();
with (star.graphics) {
lineStyle(0);
moveTo(hankei,0);
beginFill(0xdcdcdc);
for (var i:int = 1; i < 11; i++) {
hankei2 = hankei;
if (i % 2 > 0) {
hankei2 = hankei/2;
}
//360度(ラジアン値)を10等分したうちのいくつ分
var angle:Number = Math.PI * 2 / 10 * i;
lineTo(Math.cos(angle)* hankei2,
Math.sin(angle)* hankei2);
}
}
this.addChild(star);
star.x = 230;
star.y = 230;
}
}
}