1

我有一个UIImageView在屏幕上移动的,当它与另一个在一定距离内时,我试图触发一个方法UIImageView,也在移动。我不一定要检查任何特定时间,我想知道它在那个距离内的任何时间。帮助!

EDIT: I have multiple objects(the enemies) moving down the screen while the player is at the bottom of the screen. When the user taps the screen, it "shoots"(a new projectile object is created and the animation to move it up the screen is started). I am trying to detect when the "projectiles" hit the "enemies" and triggering an event(i.e. killing the enemy). I have no idea where to put the code to do this, or even what to do. Do I want to use the Notification System, or do I want to calculate if the projectile will hit the enemy as soon as it is fired?

4

1 回答 1

0

您可能想使用Key-Value Observing是一个例子。

于 2013-06-22T23:53:37.597 回答