Draw Circle 沿着圆运动

import flash.display.MovieClip;


var vx:Number = 0;
var vy:Number = 0;

var xspeed:Number = 0.05;
var yspeed:Number = 0.05;

var i:int=0;

var xpoint:Number ;
var ypoint:Number ;

var targetXPoint:Number = stage.stageWidth / 2 + 100;
var targetYPoint:Number = stage.stageHeight / 2;

var X:Number = stage.stageWidth / 2;
var Y:Number = stage.stageHeight / 2;

var radius:Number = 100;

addEventListener(Event.ENTER_FRAME,enterhs);

function enterhs(evt:Event):void
{
this.graphics.lineStyle(1,0x000000,1);
//this.graphics.moveTo(xpoint,ypoint);
///////////公式:起始点X坐标=圆心X坐标+COS(移动速度)*半径;

/*vx += xspeed;
vy+=yspeed;*/

i++;
xpoint = X + Math.sin(i/180*Math.PI);
ypoint = Y + Math.cos(i/180*Math.PI);

/*trace(vx+"==========="+vy)
xpoint = X + Math.cos(vx) * radius;
ypoint = Y + Math.sin(vy) * radius;*/

//this.graphics.lineTo(xpoint, ypoint);
this.graphics.drawCircle(xpoint,ypoint,50);


}

Draw Circle 沿着圆运动

上一篇:Draw Circle 沿着圆运动~


下一篇:在VIM中保存编辑过的只读文件