Hello,

I was looking at the RectMapCollider and its do_collision method. The 
docstring says:

*"""2. If the "dx" and "dy" values are passed in the methods*
*collide_<side> will be called to indicate that the rect has*
*collided with the cell on the rect's side indicated. The value*
* passed to the collide method will be a *modified* distance based*
*on the position of the rect after collision (according to step*
*#1)."""*

This seems like an excellent idea. But looking at the code:
        g = cell.get
        if g('top') and last.bottom >= cell.top and new.bottom < cell.top:  
            dy = last.y - new.y
            new.bottom = cell.top
            if dy:
                self.collide_bottom(dy)

It seems to me that the velocity won't be update. The lines are in the 
wrong order. It should be instead:
        g = cell.get
        if g('top') and last.bottom >= cell.top and new.bottom < cell.top:  
            new.bottom = cell.top
            dy = last.y - new.y
            if dy:
                self.collide_bottom(dy)

Or is there something I'm missing?

Regards,
Dan.

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to