Hello! I'm glad i found this forum.

I just started learning Qt a few days ago, and currently i am trying to make a simple game.

I have read the docs, but maybe i am a bit slow in understanding things so i had to ask a few "newb" questions..
( I already run a forum search and checked through all of them that may seem related. )

So I wanted to make a side-scrolling, with rectangles for the road and the character running on top of them. I made 2 classes, lets say:
Qt Code:
  1. class Block: public QGraphicsItem
  2. {
  3. ...
  4. }
  5.  
  6. class Character: public QGraphicsItem
  7. {
  8. ...
  9. }
To copy to clipboard, switch view to plain text mode 
if the Character instance is not standing on top of a Block instance, then it would freefall down.
My question is, how and where do I define the collision? I've read about
Qt Code:
  1. virtual bool collidesWithItem ( const QGraphicsItem * other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape ) const
To copy to clipboard, switch view to plain text mode 
I was thinking about implementing this in Character class as method but it needs QGraphicsItem *other as parameter.. :S


Thank you for your help!