We show the goal on the screen, but we want to detect when the player touches the goal and then end the game.
The first thing we need is a boolean variable that keeps track of whether or not the game is over. This should be initialized to false.
Now that we have this variable, we can set it to true when the player touches (collides with) the goal that we just added.
We do that by creating a new check_goal_collisions() function that checks for collisions between the player and the goal.
We're also temporarily adding a "dummy" version of the collide() function. This dummy version does nothing except return false (meaning no collision found). We'll be creating a proper version of collide() once we finish hooking up the goal collision code. We'll add a "NYI" comment to indicate that it's "Not Yet Implemented".
And finally, we can update check_collisions() to call this new function and check for goal collisions as well as platform collisions.
The only thing missing is a proper implementation for the collide() function. We'll add that now.