ボール

by 084
♥0 | Line 33 | Modified 2011-11-05 21:28:37 | MIT License
play

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/1SoJ
 */

package{
	import flash.display.Sprite;
	public class Test extends Sprite
	{
		private var ball:Ball;
		
		public function Test()
		{
			ball = new Ball();
                         ball.x = stage.stageWidth/2
                         ball.y = stage.stageHeight/2 
			this.addChild(ball);
			 
		}
	}
     }



	import flash.display.Sprite;
	class Ball extends Sprite
	{
		private var hankei:Number;
		private var iro:uint;
		
		public function Ball(hanikei:Number = 10, iro:uint = 0x666666)
		{
			this.hankei = hanikei;
			this.iro = iro;
			
			init();
		}
		private function init():void
		{
			graphics.beginFill(iro);
			graphics.drawCircle(0, 0, hankei);
			graphics.endFill();
                        
		}
	}




	
	 

Forked