Just adding to Claudio's reply.

On 01/11/13 16:17, John Ladasky wrote:
> [...]
> 
>     Your update method should not call sp.draw(); You always draw in the
>     .draw method.
> 
> 
> This is interesting.  How does Pyglet know that the position variables
> of a Sprite object have been changed?  Where is the redrawing handled?
>  In any case, I deleted the sp.draw() call in MyWindow.update().  The
> program behaved exactly as before.  It ran for a while, then froze.

Because when you do:

sp = self.sprite

sp holds the same object you have in self.sprite, so changing sp will
change self.sprite too (that is the one is used by on_draw).

on_draw is run when is required, update is run when you schedule it (in
this case 1 / 60.0).

> [...]
> 
>     For smooth movement the position update should use the received dt, like
>     sp.x += sp.vx * dt
> 
> 
> OK, I see the advantage of that.  My program assumes that each tick of
> the clock will come in more or less exactly on time.  If it does not,
> you want to adjust for the delay.

Read this for further info:

http://pyglet-current.usebox.net/programming_guide/time.html#animation-techniques

> [...]
> 
> But to answer your question: on my Linux system, examples/noisy/noisy.py
> ALSO stops working, after runs of 30 seconds to a few minutes.  I
> haven't tried on Windows 7 yet.

I can't reproduce your problem with Python 3.2.3 on Linux 32-bit.

When it "stops working", what happens? does it crash? does the app
freeze? or did the image just stop moving?

How do you end the application when is frozen? Does "ESC" work?

We're going to need more information with this one :)

Regards,

Juan

-- 
jjm's home: http://www.usebox.net/jjm/
blackshell: http://blackshell.usebox.net/

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to