On 05/06/2009, at 9:10 AM, Steve Johnson wrote:
>> OK, I'll re-word my explanation a little. You scrape the class for
>> special attributes and create instance attributes in
>> GameObject.__init__.
>
> My problem with your solution is that the keys dict is created
> completely outside of any instance, precluding two players from
> responding to different sets of keys. Behaviors need to be assignable
> on the fly. The solution I posted is more explicit, more flexible, and
> pretty much as short as the 'scraping' version.

Hmm. OK, perhaps there's a different approach that might be taken. I'm  
just a little put off by the __init__ / super() yuckiness.

How much other customisation would you expect on the Player class? Is  
the customisation just supplying information to the GameObject class  
(as arguments or filling out GameObject attributes?) What other sorts  
of GameObjects can you see there being?


> I had forgotten that Cocos2D existed until yesterday, which makes me
> think that this framework might be completely superfluous, but I think
> I'll continue to work on it because I'm enjoying it

Cocos2d is great, but it's not perfect. In particular there's places  
where it tries to do too much; it was refactored at one point to  
greatly expand scope but it's not quite right (it's easy to trigger  
bugs by eg. rapidly changing scenes with transitions, and operations  
on sprite groups often don't work). Some of the internal code isn't  
pretty and it's quite hard to follow in places. Having said that  
Cocos2d has a pretty good API, and its scene/layer/animation controls  
are a great idea. I suspect that it might benefit from a ground-up re- 
implementation (as was done for the iPhone library, I'm sure - in fact  
there might even be lessons that could be learned from that effort?).

Consider also that there's Rabbyt which also provides some animation  
framework elements, but uses a different API approach to Cocos2d.  
Probably worth looking at.


     Richard


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" 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/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to