rsandor/gury — Issue #13: Unify play and draw
Author: mitar
Created: 2011-11-09 12:49:47+00:00
State: open

Currently it is really cumbersome to switch between play and draw. Most of the time I have a static drawing, but for some effects I use animation. Because I would like to keep CPU usage for clients low I do not want to "play" all the time.

So I have a proposal: let objects added to the drawing queue have additional method "animate" which returns true or false if it is necessary to animate it (and call "update" and so on). Then provide additional method (to keep things backwards compatible) called "run", which would do something like every few ms: go trough all objects and call "animate". If any object returns true, call update on it. At the end, if any object returned true from "animate", redraw. Otherwise do nothing.