[Kde-games-devel] Questions about basic game programming

Stefan Majewsky majewsky at gmx.net
Thu Feb 19 16:04:12 CET 2009


On Donnerstag 19 Februar 2009 15:51:14 Luciano Montanaro wrote:
> 2009/2/19 Pierre Maurier <pierre.maurier at gadz.org>:
> > - How can I create a "time-based program" ?
> > All my applications I wrote until now used to be action-based : a
> > function is called by a click/keypress of the user. Here I want to create
> > something that react after x time (and also react after user actions of
> > course, it's a game !). Is there a proper way to do this ?
>
> You set up a QtTmer to emit a signal at the time you ant to trigger an
> action. Or you set it up so that it emits a signal every x
> milliseconds...

Basically, any QObject can start timers. The Qt documentation explains these 
in detail, look at QObject::timerEvent and QObject::startTimer.

> > - Which widget I have to use to draw things ?
> > The only games I have created (centuries ago !) where in Action Script
> > (Macromedia Flash). This was very easy because you can use flash drawings
> > and move them on the screen using coordinates. Is there a similar thing
> > in Qt ? What are you using kdegames ?

We are using SVG graphics together with the Graphics View framework. Have a 
look at the QGraphicsView and QGraphics(Svg)Item classes.

Greetings
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20090219/fb331162/attachment.sig 


More information about the kde-games-devel mailing list