xxcainiao

记录一些常用的三角公式

 
// substitute mouseX, mouseY with the x, y point to rotate to
dx = mouseX - sprite.x;
dy = mouseY - sprite.y;
sprite.rotation = Math.atan2(dy, dx) * 180 / M
 
创建波形:
// assign value to x, y or other property of srite or movie clip,
// use as drawing coordinates, etc.
public function onEnterFrame(event:Event){
value = center + Math.sin(angle) * range;
angle += speed;
}
 
创建圆形:
// assign position to x and y of sprite or movie clip,
// use as drawing coordinates, etc.
public function onEnterFrame(event:Event){
xposition = centerX + Math.cos(angle) * radius
yposition = centerY + Math.sin(angle) * radius
angle += speed;
}

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-24
  • 2021-07-16
  • 2021-08-17
  • 2021-10-14
  • 2021-12-03
  • 2021-09-20
猜你喜欢
  • 2021-12-04
  • 2022-01-27
  • 2021-11-24
  • 2022-12-23
  • 2021-07-24
  • 2021-12-23
  • 2021-08-02
相关资源
相似解决方案