向抛掷方向抛掷物体
我一直在尝试创建一个函数来使用“触摸”来投掷物体,并使其与投掷方向成一条直线,非常接近“纸投掷”。有什么想法吗?谢谢!
I've been trying to create a function to toss an object using 'touch' and make it go in a straight line with the direction it was tossed in, very close to "paper toss". any ideas? thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个关于如何构建此类代码的很棒的教程:
http://www.raywenderlich.com/25791/rotating-turrets-how-to-make-a-simple-iphone-game-with-cocos2d-2-x-part-2
它将给你直线。如果需要深度,则必须添加缩放函数。抛纸会根据绘制的路径而有所不同 - 他们使用贝塞尔曲线。
迟到总比不到好。
干杯。
There's a great tutorial on how to build this sort of code:
http://www.raywenderlich.com/25791/rotating-turrets-how-to-make-a-simple-iphone-game-with-cocos2d-2-x-part-2
It will give you the straight line. You would have to add a scaling function if you need depth. Paper Toss will vary to this based on the path drawn - they use a bezier curve.
Better late than never.
Cheers.