[Kde-games-devel] A timer class for games

Alan Alpert alanalpert at optusnet.com.au
Tue Jun 16 12:56:18 CEST 2009


On Tuesday 16 June 2009 19:03:12 Ian Wadham wrote:

>A missed animation frame causes a slight flicker or "blip", e.g. the figure
>moved by 4 pixels in 40 msec instead of its normal 2 moves of 2 pixels each
>in 20 msec - total 4 pixels movement in 40 msec in either case.  The effect
>of missing an animation frame is nowhere near as bad as when the human
> player blinks, I would say.
>
> BTW, the technique I am using now might allow KGoldrunner to use
> QGraphicsView some day, although when Mauricio and I last tried
> it, it was sometimes taking up to 900 msec to complete a 60-70 msec
> animation step.  Now *that's* jerky!  It was so slow and unpredictable
> as to make the game actually unplayable at times.  That was in Qt 4.0.

QGraphicsView has undergone heavy optimization recently (mostly in Qt 4.5*). I 
recommend that you give it another chance when Qt 4.6 comes out and you will 
probably be pleasantly surprised by its speed.

Speaking of recent features, you should consider QTimeline** (new in 4.2) if 
you haven't already. It was designed for animations and so hopefully avoids 
jerkiness.

*http://labs.trolltech.com/blogs/2009/03/03/performance-and-qt-45/
**http://doc.trolltech.com/4.5/qtimeline.html
-- 
Alan Alpert


More information about the kde-games-devel mailing list