简体   繁体   中英

Move an imageView along a circular path

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 ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM