Hello,
I am using QGraphicsScene , QGraphicsView and QGraphicsPixmapItem to write a game like Tank.
I have wrote a class Tank inherriting from QGraphicsPixmapItem, and when I press some key, like Space, it's function shoot() is called. And I want to new some bullet in this function, then let the bullet go straight along the current direction.
The class Bullet is inherriting from QGraphicsPixmapItem too.
The problem is, I do not know how to detect whether the bullet reaches the border or hit the enemy tank, if it hits some enemy tank, how to destroy that tank.
I am using Qt4.5
Thanks in advance!!
Bookmarks