Hello list,

I've been hacking on a game lately (hope to be able to show it soon!),
and I noticed that it was munching all my CPU and running at about
10fps.

Profiling a bit I realized that it was spending most of the time
visiting nodes; the game is played on a 14x14 board, and I'm using a
Sprite for each tile.

I hacked up cocos.sprite.Sprite so that it would accept a batch
keyword argument on construction to pass the pyglet.sprite.Sprite's
constructor, and it worked wonderfully, CPU usage disappeared and fps
was through the roof.

I then saw cocos.sprite.BatchNode and family so I tried to use that
instead, but I've failed miserably.  Nothing I do seems to bring the
benefits of pyglet's batch.  I looked at the demo's in test_batch.py
and test_batch2.py but they don't do any real work with the BatchNode
they create as they only draw the batch once.  I then looked at
tiles.py (as it solves the same problem I'm solving, some how) and
alas, it uses pyglet's batch, not BatchNodes.

So, could somebody show me how to use BatchNodes to draw say 50 or 100
sprites at about 20 fps?  Is BatchNode broken?  Is it meant for
something else?  If so, couldn't we make cocos.Sprite accept a 'batch'
parameter to pass to pyglet's Sprite constructor?



-- 
Anthony Lenton

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