You are on page 1of 1

The game will consist of having flies and lady bugs pop up in random locations on the screen for a

certain amount of time and the player will use the mouse to swat the flies thus earning points. The time that
the fly stays on the screen will decrease over time once the player reaches a certain score. The game will end
when the player fails to swat a fly or a lady bug is swatted.

Fly, inheriting from games.Sprite


Class Attributes:
image – a picture of a fly using games.load_image()
time - the length of time the fly stays displayed on the screen
Attributes:
(none)
Methods:
__init__() - just calls the super class's constructor,
Using the fly image makes flies pop up randomly on the screen
update() - override the sprite update method to make the fly check to see if it should end the game
test to see if has reached the bottom of the screen,
and to end the game if it has
swat() - Method used by swatter to tell the fly that it has been killed
end_game() – Method used by a Fly’s object's update() method
if the fly disappears before it is swatted, game will be ended

Ladybug, inheriting from games.Sprite


Class Attributes:
image – a picture of a ladybug using games.load_image()
time – the length of time the ladybug stays displayed on the screen
Attributes:
None
Methods:
__init__() - just calls the super class's constructor,
Using the ladybug image makes ladybugs pop up randomly on the screen
update() - override the sprite update method to make the ladybug check to see if it should end the
game
test to see if has reached the bottom of the screen,
and to end the game if it has
swat() - Method used by swatter to tell the fly that it has been killed
end_game() – Method used by a ladybugs object's update() method
if the ladybug is swatted the game will be ended.

Swatter, inheriting from games.Sprite


Class Attributes:
image - an image object obtain using games.load_image()
Attributes:
score - a Text object that displays the player's current score
Methods:
__init__() - calls the super class's constructor, using the swatter image
placed over the mouse which is what will control the x & y;
Makes the score attribute and places it on the screen
update() - override the sprite update method to make the swatter move with the mouse