How to handle several types of conflicts in C ++?

I am creating a game in C ++ using Qt. I got the correct collision detection using GraphicsItem methods. The fact is, I don’t know how to handle every other type of collision, since there are different objects with different behaviors.

+1
c ++ qt
source share
2 answers

In fact, you can find out what type of object is involved in a collision, through a custom type, see the documentation for more information http://doc.qt.io/qt-5/qgraphicsitem.html#type

0
source share

I assume that you are using one of the collidingItems or collidesWithItem methods. Of these, you will get a list of QGraphicsItem s. Then it's just a casting question to determine what is striking and responsive.

0
source share

All Articles