In previous articles we have learned
to draw a sprite image
apply it to Qt via QPixmap
so we turned animated explosion. And now we need to put this very explosion at precisely the place where the bullet hits. That is, the bullet will explode.
For the implementation of this ideas will add class sprite from the past lessons, and modify it. The fact is that the sprite object is a class inherited from
, and therefore a bullet when confronted with the explosion of another bullet will behave as well as in a collision with an obstacle or a target. Therefore it is necessary to do so to ignore the bullets from the other explosions and bullets flying through.
The project is subject to modification in the sense that a new class is added to the following files:
This class will be called animated sprite explosion, after which this frame object will be removed from the graphic scene.