# cocos2dx-Action-圆周运动

if srpite == nil then return end
srpite:stopAllActions()
local cfg = cfg or {}
local cirCleR = cfg.cir or 50
local dir = dir or 1
local x = 0
local y = 0
local  beagainX  = bX or srpite:getPositionX()
local  beagainY  = bY or srpite:getPositionY()
local convRtain = srpite:getRotation() >= 360 and  1 or srpite:getRotation()
local function Run_Crile()
x = beagainX + (math.cos(convRtain * 3.14 / 180) * cirCleR)
y = beagainY + (math.sin(convRtain * 3.14 / 180) * cirCleR)
srpite:setRotation(90-convRtain)
srpite:setPosition(x ,y )
convRtain = convRtain >= 360 and 1  or convRtain + 1 * dir
end
local cfun = cc.CallFunc:create(Run_Crile)
local ccSequencde = cc.Sequence:create(cfun)
srpite:runAction(cc.RepeatForever:create(ccSequencde))

#### Cocos2d-x教程(16)－自定义动作 圆周运动

2013-12-27 10:06:30

#### cocos2dx学习笔记：自定义动作实现圆周运动

2014-12-08 14:57:13

#### Cocos2d-x －自定义动作 圆周运动

2014-06-13 18:19:36

#### JS原生之--圆周运动（转转转）

2016-09-22 08:59:45

#### [iuud8]基于cocos2dx3.2自定义圆周运动

2015-05-31 17:52:41

#### cocos-圆周运动 物理方法

2016-06-21 18:52:18

#### cocos2d 圆周运动 c++到lua的封装

2017年07月03日 1KB 下载

#### 继承ActionInterval来实现圆周运动之CircleBy

2015-06-03 15:26:12

#### cocos2d 绕椭圆移动

2014-10-27 09:34:35

#### cocos2d-x实现node圆弧运动

2012-03-26 10:17:06