Looks good!

One little comment though, on the pyglet side, you mention the
@window.event style of attaching event handlers, but not the
window.push_handlers style. In my experience (mostly answering
questions on IRC), this is the source of a lot of problems that
beginners have when moving from very simple examples to slightly less
simple projects of their own. The decorator syntax, while extremely
convenient, is open to a lot of confusion. It's typical to see code
like this:

class Foo(object):
  def __init__(self):
     self.window = pyglet.window.Window()

  @self.window
  def on_draw(self):
    blah blah blah

Now, *I* understand why this doesn't work, but it's fairly subtle, and
not that easy to work out unless you're quite familiar with when
Python executes code in a class statement. This tendency seems to stem
from beginners thinking that decorators are the "standard" way of
attaching event handlers. In my experience, they're not really very
useful outside of simple scripts, and certainly shouldn't be given
prominence over the more generally useful push_handlers approach.

Martin

On 8 July 2010 07:24, Richard Jones <[email protected]> wrote:
> Hi all,
>
> In preparation for my Intro to Game Programming tutorial at EuroPython
> on the 18th I've been putting together a quick reference for cocos2d
> and pyglet. It's two pages (two sided). The first is cocos2d and the
> second is pyglet.
>
> In this revision I've:
>
> - altered the documentation about Layer.init and Scene.init
> - added a mention of cocos2d's default auto-scaling (and when it
> should be avoided)
> - put a little more info in (more on cocosnodes)
> - added info about pyglet animations
>
> Comments and suggestions are welcome.
>
>
>     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.
>
>

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