## Prelab 10 Notes

### When did we talk about…

This lab focuses on object-oriented programming (OOP) with PyGame, that is the topics we discussed this week. In particular the example games and code will be most relevant.

### Nouns and verbs

In this lab we will implementing the “Piper Game”. The sand piper must race the clock to collect as many clams on the beach without getting wet. A screencast of a run of the game is shown below.

As we did earlier in class, let’s enumerate the functionality in the game: (Show some potential functionality:)

• Move the player (i.e., change the piper’s position)
• Move the wave back and forth
• Randomly generate clams on the right half of the screen
• Check if a player and a clam collide, if so “collect” the clam, making it invisible (and incrementing the score)
• Check if a player and the wave collide, if so end the game

As before, the red words, or nouns, are the data in our game and the blue words, or verbs, are the actions we to apply to those nouns. The nouns generally map to our Player, Clam and Wave classes while the blue verbs map to methods.

Do you see any nouns that might map to instance variables? Show some potential instance variables:

We are looking for nouns that seem to “belong” to other nouns. One we noted previously, position. The other is invisible, i.e., whether the clam is visible or not.