Python Forum

Full Version: pyjama - frame every x seconds?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi folks.

I've worked with a couple of game engines before where this would be pretty easy, but I can't find a good example of updating the display every x seconds.

I understand frame rates, do I need another thread updating the background data while the app churns out frames? Or can I update every x seconds?

Thanks.
I don't know about pyjamas, but since it looks like it's just a python-javascript compatability layer, I'm not sure it would make sense to re-build the dom every x seconds. You could use the Timer class to do background tasks: http://pyjs.org/api/library.pyjamas.Time...class.html

The Asteroids example also uses a Canvas class, which has a draw() method that might get called every frame. But I don't actually see the Canvas class in the docs anywhere.
I don't know much about pyjamas either.

And why am I a "Silly Frenchman"?