On Thursday 20 August 2009, claudio canepa wrote:
> On Thu, Aug 20, 2009 at 12:55 PM, Chris Laux <[email protected]> wrote:
> > On Thursday 20 August 2009, Richard Jones wrote:
> > > On 18/07/2009, at 2:13 AM, Chris Laux wrote:
> > > > I've been playing with Cocos' tile module a bit lately, and I think
> > > > I found a
> > > > bug in RectMapLayer.get_in_region. I'm using it with a manually
> > > > created map
> > > > (not using the xml map loader) for basic collision detection.
> > > > Without this
> > > > change, I would get more cells than I should and would hit walls 1
> > > > cell early
> > > > on the bottom and left. AFAICT, it isn't affecting test_tiles.py one
> > > > way or
> > > > the other. Are there any other tests out there to verify this
> > > > bug/fix?
> > >
> > > Thanks for this, I've committed the fix and added a test for it (along
> > > with a ton of others and a bunch of new cocos.tiles functionality like
> > > collision detection stuff)
> >
> > Sweet, but the test (test_tiles_model.py) doesn't run afaict - it can't
> > import
> > Rect. I tried hacking it up a bit, but no luck.
> >
> > Attached are some functions I wrote to make maps out of simple text
> > files, I
> > don't know if they're suitable for inclusion in cocos. I'm using them as
> > a quick & dirty way to make simple maps.
> >
> > --
> > -chris
>
> Are you running cocos svn ? one of the the latest log tells Rect added to
> svn trunk
>

Yes, fresh checkout from http://los-cocos.googlecode.com/svn/trunk/. Here's 
the tracebacks:

ch...@laptop:~/newcocos/cocos2d/test> python test_tiles.py 
Traceback (most recent call last):                         
  File "test_tiles.py", line 38, in <module>               
    test_layer = tiles.load('road-map.xml')['map0']        
  File "../cocos/tiles.py", line 374, in load              
    obj = Resource(filename, paths)                        
  File "../cocos/tiles.py", line 258, in __init__          
    self.handle(root)                                      
  File "../cocos/tiles.py", line 294, in handle            
    return self.factories[tag.tag](self, tag)              
  File "../cocos/tiles.py", line 273, in resource_factory  
    self.handle(child)                                     
  File "../cocos/tiles.py", line 294, in handle            
    return self.factories[tag.tag](self, tag)              
  File "../cocos/tiles.py", line 557, in rectmap_factory   
    m = RectMapLayer(id, width, height, cells, origin, properties)
  File "../cocos/tiles.py", line 853, in __init__                 
    RectMapLayer.__init__(self, properties)                       
TypeError: __init__() takes at least 5 arguments (2 given)        


ch...@laptop:~/newcocos/cocos2d/test> python test_tiles_model.py 
Traceback (most recent call last):                               
  File "test_tiles_model.py", line 13, in <module>
    from cocos.tiles import Rect, RectCell, RectMap, HexCell, HexMap, Tile
ImportError: cannot import name Rect
ch...@laptop:~/newcocos/cocos2d/test> python test_tiles.py
Traceback (most recent call last):
  File "test_tiles.py", line 38, in <module>
    test_layer = tiles.load('road-map.xml')['map0']
  File "../cocos/tiles.py", line 374, in load
    obj = Resource(filename, paths)
  File "../cocos/tiles.py", line 258, in __init__
    self.handle(root)
  File "../cocos/tiles.py", line 294, in handle
    return self.factories[tag.tag](self, tag)
  File "../cocos/tiles.py", line 273, in resource_factory
    self.handle(child)
  File "../cocos/tiles.py", line 294, in handle
    return self.factories[tag.tag](self, tag)
  File "../cocos/tiles.py", line 557, in rectmap_factory
    m = RectMapLayer(id, width, height, cells, origin, properties)
  File "../cocos/tiles.py", line 853, in __init__
    RectMapLayer.__init__(self, properties)
TypeError: __init__() takes at least 5 arguments (2 given)


-- 
-chris

--~--~---------~--~----~------------~-------~--~----~
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