I'm writing a little game in cocos2d, trying to use the Bezier Action
and Bezier path to make a Missile fired from a Capitol Ship the
missile fly at the Mother Ship in a cool, loopy kinda way.

My problem seems to be what I think is a position isn't what Bezier
thinks is a position. I give it the Mothership position, and the
Missile starting position (wherever its Capitol Ship is at the time) ,
and tell the Missile to make it's way to the Mothership.

However, the Bezier Path seems to think 0, 0 is where ever the Missile
has spawned, not absolute position on the screen.

How can I get the Bezier Path to take absolute position? Here's the
bit of code from the Missile class

    def hitTarget(self):
        tx, ty = self.target.position
        mx, my = self.position
# this bit of code makes the missile do weird things
#        path = BezPath( (mx, my), #first point
#                  (tx, ty), #end point
#                  (mx-10, my-20), #second point
#                  (mx-20, my-30)) #third

#this bit of code makes the Missile spawn correctly, but will I have
to calculate the relative position
#of the mother ship to make it hit?
        path = BezPath( (0, 0), #first point
                  (0, 0), #end point
                  (-10, -20), #second point
                  (-20, -30)) #third

        self.do(BezAction(path, 2 ))

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to