Our spritesheet has 6 different fruit that we can use in our levels. So lets add the others into the game. We'll keep it simple and cycle through the fruit when we advance levels. So the first level will use the cherries, the second level will use the bananas and so on. The sixth level will use the watermelon, then when we get to the 7th level we're back to cherries. We'll also increase the number of points the fruits give you as you advance in levels. So a fruit in level 5 will give you more points than a fruit in level 2. Also, when we eat a fruit it appears in the lower right corner of the screen. It just lets you know that you captured a certain fruit. But it will only show one type of fruit, so if you eat the cherries twice in a level or in different levels, for example, then it will only display 1 cherry icon in the lower right corner.
So the main thing here is that we're going to increase the points you get from a fruit depending on the level you're on. As you can see we just increase the points by 20 for every level. There should probably be a cap, but it's unlikely someone will play until level 1,000,000 for example.
In the FruitSpries method we'll add the (x,y) locations of the other fruit on the spritesheet. We also need to pass in teh level so we know which fruit to get. We'll just loop through the fruit as we loop through the levels. So cherries will appear on the first level, but they'll also appear every 6 levels as well.
So we need to check to see if we've captured the fruit already. If we've already captured the fruit, then there's no need to capture it again. We do that with the get_offset() method which is built into pygame. It basically checks to see if the image is coming from the same location on the sprite sheet. If it is, then it's going to be the same image. If it's coming from a different location then it's a different image or a different fruit.
Once we eat a fruit we want to show it in the lower right corner of the screen. This is similar to showing the life icons in the lower left corner of the screen.