An aeroplane which is moving in a bezier path action should collide by a missile which also moves in a bezier path when a ccmenu button is clicked. The problem is when the missile is launched the plane is on one position but when it(missile) reaches that point the plane moves to other position.It is happening due to the duration both the actions have .So how to find the position of the plane so that it is hit by a missile?It is a simple cocos 2d game.Please help?
Asked
Active
Viewed 86 times
-1
-
so what happens when you press the ccmenu button? is that when the missile is launched? – AbhinavVinay Aug 15 '12 at 17:31
-
yes the missile is launched after pressing the button – muhit999 Aug 17 '12 at 08:15
1 Answers
0
yI am not sure what exactly you are looking to do, but here is one possible solution:
When you press the button launch the missile and use CCMoveTo to make it move to the position of the plane.
[CCMoveTo actionWithDuration:time position:ccp(aeroplane.position.x,aeroplane.position.x)];
As long as you make sure the duration for this is low enough the missile will hit the plane.

AbhinavVinay
- 303
- 6
- 18