262 Chapter 10
final challenges, use the skills you learned in version 2.0 of
the SmileyPop app to upgrade Smiley Pong v2.0 to v3.0 by
adding sound effects to the point and miss bounces. Save
this new file as SmileyPong3.py.
#2: Hits and Misses
To make the SmileyPop app even more game-like, add logic
to keep track of the number of hits and misses out of the
total number of clicks. If the user hits any smiley sprites
when they right-click, add 1 to the number of hits (1 hit
per click—we don’t want to duplicate count_popped). If the
user right-clicks and doesn’t hit any smiley sprites, record
that as a miss. You could program the logic to end the
game after a certain number of misses, or you could give
the user a certain number of total clicks to get the high-
est percentage they can. You might even add a timer and
tell the player to create and pop as many smiley bubbles
as they can in, say, 30 seconds. Save this new version as
SmileyPopHitCounter.py.
#3: Clear the Bubbles
You might want to add a “clear” feature (or cheat button) to
pop all the bubbles by hitting a function key, sort of like our
“play again” feature in Smiley Pong. You could also make
the bouncing smiley faces slow down over time by multiply-
ing their speed by a number less than 1 (like 0.95) every
time they bounce off an edge. The possibilities are endless.