[Kde-games-devel] kspaceduel: porting to Graphics View
Dmitry Suzdalev
dimsuz at gmail.com
Fri Dec 29 10:53:22 CET 2006
2006/12/29, Dirk <dirkrathlev at gmx.de>:
> 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?
Returning S_BULLET is ok as long as it is larger than
QGraphicsItem::UserType (65535) as stated in docs. If it is less you
may run into trouble once :-).
And I think that using type for your purposes is perfectly ok.
> At least it works.
That doesn't mean it can't break some day if you use it incorrectly now ;-).
Cheers,
Dmitry.
More information about the kde-games-devel
mailing list