We just need to know when certain objects from our game touch certain other objects. We can then respond to that event in an appropriate manner. In our classes, we have already added functions to call when our objects collide. They are the following:
Playerclass has a
hitfunction. We will call it when a zombie collides with the player.
Zombieclass has a
hitfunction. We will call it when a bullet collides with a zombie.
Pickupclass has a
gotItfunction. We will call it when the player collides with a pickup.
If necessary, look back to refresh your memory on how each of those functions works. All we need to do now is detect the collisions and call the appropriate functions. We will use rectangle intersection to ...