[Kde-games-devel] kspaceduel: porting to Graphics View

Dirk dirkrathlev at gmx.de
Fri Dec 29 00:05:22 CET 2006


Dmitry Suzdalev wrote:
> There's a third possibility:
>
> You can use qgraphicsitem_cast instead of static_cast.
> It should be faster, but you need to prepare you QGraphicsItem-inherited class 
> for its use.
>
> See http://doc.trolltech.com/4.2/qgraphicsitem.html#qgraphicsitem_cast for 
> information on how to do that :-).
>
>   
Hmm, BulletSprite already has a type() function. It returns S_BULLET and 
is used in collision detection. As S_BULLET is unique, I think I don't 
have to change anything. But is this good style, using type() for 
gameplay issues?

At least it works.

Regards,
Dirk


More information about the kde-games-devel mailing list