Lab 4: Tourist Observer (Part 2)

This also is an individual lab.

In this week’s lab you will extend your solution to an earlier lab by adding two challenges. The first is to find the word “MSOE” by tagging cars with those letters anywhere in their license plates. This challenge is available from the start of the game and is signaled by the message “Challenge: Find all the letters in MSOE” at the top of the status area. The cars can be tagged in any order, and each letter is shown in the challenge area when it has been matched. When the user has found all four letters, display the message “MSOE CHALLENGE COMPLETED” in place of the message showing which of the “MSOE” letters have been found.

The second challenge is an Easter egg: the user only discovers this challenge once the person tags a bus. The message for this is “Challenge: Find all letters in BUS”. As for the cars, the player attempts to spell a word by finding the appropriate letters in car license plates. In this case, the target word is “BUS”. When all three letters have been found, replace the “Found: ***” line by “BUS CHALLENGE COMPLETED”. Note that there is overlap between the target words, so in some cases finding a letter can make progress in both license plate challenges. On the other hand, if the player finds the S for the initial challenge before activating the bus challenge, then an S will need to be found again to satisfy the BUS challenge.

The following picture shows all three challenges in progress:

This shows what it looks like after the player has tagged the art museum, plates with the letters M and O, and a bus. Note all of these items are shown in the right hand (status) window. The asterisks show which letters are still missing. The initial game status would be shown as

Challenge: Find all the letters in MSOE
Goal: MSOE
Found: ****

Challenge: Find art

Hints

Sketch a new UML class diagram illustrating the new subjects and observers you plan to implement this week. Consider what events you will want to detect and how each observer will respond to those events being detected.

Implement the observer for license plates matching the goal “MSOE”. You should be able to implement the observer for matching the goal “BUS” by reusing previous observers.

Additional requirements

Revisit the design guide and requirements from last week’s lab. Be sure to isolate the Observer from the Subject and to make only minimal edits to the original classes as described there.

Submission

See your instructor for submission directions.

This lab was developed by Dr. Yoder in Winter 2018–19.