cocos2dx
2点間の方向を取るときはこんな感じ※math.hを読み込む必要があります。 /* * 現在地と目的地からDirectionを求めます。 */ int HogeView::calcDirection(cocos2d::Point from, cocos2d::Point dist) { auto x = dist.x - from.x; auto y = dist.y - from.y; …
2点間の方向を取るときはこんな感じ※math.hを読み込む必要があります。 /* * 現在地と目的地からDirectionを求めます。 */ int HogeView::calcDirection(cocos2d::Point from, cocos2d::Point dist) { auto x = dist.x - from.x; auto y = dist.y - from.y; …