当前位置: 首页 > 工具软件 > Android Angle > 使用案例 >

角度 Angle

邓欣可
2023-12-01



 CGPoint vector = ccpSub( creep.mySprite.position,touchLocation);
 CGFloat vectorAngle = ccpToAngle(vector);
            
     int speed = 100;
 CCMoveBy *creepMove = [CCMoveBy actionWithDuration:0.5 position:ccp(speed*cosf(vectorAngle),//0
                                                                               speed*sinf(vectorAngle))];
 [creep.mySprite runAction:creepMove];



 类似资料: