开发者

Move an imageView along a circular path

开发者 https://www.devze.com 2022-12-19 21:42 出处:网络
I\'m developing a game in which I\'ve imageviews for bow and arrow. I actually wanted to move this arrow along a circular path开发者_运维知识库 when set in the air. Specifically, this circular path sh

I'm developing a game in which I've imageviews for bow and arrow. I actually wanted to move this arrow along a circular path开发者_运维知识库 when set in the air. Specifically, this circular path should be the one which an object will travel when thrown in the air at a distance i.e. it'll move upwards first and then downwards.

I've already tried using CAKeyFrameAnimation but the curved path drawn was actually down first and then up, objects don't usually travel that way.

I have already seen other articles related to this on Stack Overflow and nothing seemed suiting my requirements. I hope I didn't miss anything.


I've already tried using CAKeyFrameAnimation but the curved path drawn was actually down first and then up, objects dont usually travel that way

Sounds like all you need to do is change your math for the y axis. Do your current math but multiply the y axis delta by -1.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号