Re: Collision Error

34 views
Skip to first unread message

claudio canepa

unread,
Aug 1, 2012, 9:50:16 AM8/1/12
to cocos-...@googlegroups.com


On Wed, Aug 1, 2012 at 5:07 AM, Balajee R.C <bala...@gmail.com> wrote:
I am have a level containing cshapes of both cocos.collision_model.AARectShape type as well as  cocos.collision_model.CircleShape. Is this a problem? I am getting the following traceback of what seems most likely a bug in the code base itself. I want to check here before reporting a bug in the tracker.

Traceback (most recent call last):
  File "main.py", line 22, in <module>
    gameManager.startGame()
  File "C:\Users\Balajee\Documents\localprojects\Longsword\src\gamemanager.py", line 98, in startGame
    cocos.director.director.run(self.mainScene)
  File "C:\Python27\lib\site-packages\cocos2d-0.5.0-py2.7.egg\cocos\director.py", line 451, in run
    event_loop.run()
  File "build\bdist.win32\egg\pyglet\app\base.py", line 135, in run
  File "build\bdist.win32\egg\pyglet\app\base.py", line 164, in _run_estimated
  File "build\bdist.win32\egg\pyglet\app\base.py", line 273, in idle
  File "build\bdist.win32\egg\pyglet\clock.py", line 300, in call_scheduled_functions
  File "C:\Users\Balajee\Documents\localprojects\Longsword\src\gamemanager.py", line 127, in update
    for firstObject, secondObject in self.collisionManager.iter_all_collisions():
  File "C:\Python27\lib\site-packages\cocos2d-0.5.0-py2.7.egg\cocos\collision_model.py", line 725, in iter_all_collisions
    if f_overlaps(other.cshape):
  File "C:\Python27\lib\site-packages\cocos2d-0.5.0-py2.7.egg\cocos\collision_model.py", line 424, in overlaps
    return ( abs(self.center[0] - other.center[0]) < self.rx + other.rx and
AttributeError: 'CircleShape' object has no attribute 'rx'

Can someone please tell me what might be going wrong?
  

 With the current codebase you can't mix different shapes in the same collision manager.


Balajee R.C

unread,
Aug 1, 2012, 5:44:16 PM8/1/12
to cocos-...@googlegroups.com
Thanks a ton for responding Claudio. I had the same hunch. I replaced all my shapes to Circle shapes and the collision works fine.

Thanks again for helping out.

Regards,
Balajee
Reply all
Reply to author
Forward
0 new messages