Math.tan
Math.tan
♥0 |
Line 23 |
Modified 2011-03-13 02:27:25 |
MIT License
archived:2017-03-20 01:01:11
ActionScript3 source code
/**
* Copyright Ryogo_Quberey ( http://wonderfl.net/user/Ryogo_Quberey )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/i1dU
*/
package {
import flash.display.Sprite;
import flash.events.Event;
public class Ball extends Sprite {
public var radius:Number;
public var color:uint;
public var ball:Ball;
public var angle:Number=0;
public var tangle:Number=0;
public function Ball(radius:Number = 30, color:uint=0x00ffcc ) {
// write as3 code here..
graphics.beginFill(color);
graphics.drawCircle(0,0,radius);
graphics.endFill();
addEventListener(Event.ENTER_FRAME, onEnter);
}
public function onEnter(event:Event):void{
this.x = stage.stageWidth / 2 + Math.tan(tangle)*50;
this.y = stage.stageHeight / 2 + Math.sin(angle)*50;
angle +=.1;
tangle +=.05;
}
}
}