Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 9 : Implement the program in the picture to the right. A video has also been provided showing how this program is supposed to

Lab9: Implement the program in the picture to the right. A video has
also been provided showing how this program is supposed to work
while in action. Note the following:
General Info:
The screen's size is 500500.
Files:
The 3 images needed are provided.
The 3 sound files needed are provided.
Images:
All images files are either 300300 or 400400.
You must scale the images down to 100x100 before
using them as buttons.
The laser image's center is at the exact center of the screen.
Both the on and the off button are aligned horizontally with the laser button.
The on button's right border is 20 pixels away from the laser button's left border.
The off button's left border is 20 pixels away from the laser button's right border.
Button Font:
This refers to all the Font objects rendered under the buttons.
All of these Font objects use the default Pygame font, and are size 32.
All of these font Surfaces are vertically aligned with their respective buttons.
All of these font Surfaces' top border are 20 pixels down from their respective button's
bottom border.
Status Font
This refers to the Font object right above the laser button.
This Font object uses the default Pygame font, and is size 64.
This font's Surface is vertically aligned with the center of the screen.
This font's Surface center is 80 pixels above the center of the screen.
Sounds:
Only one sound can be playing at a time.
Functionality:
While the laser is "Off", the Shoot and Power Down button do nothing.
Upon pressing the Power Up button, play the power up sound and change the status to
"Charging".
When the power up sound finishes playing, change the status to "Ready".
While the laser is "Ready", the Power Up button does nothing.
While the laser is "Ready", pressing the Shoot button plays the shoot sound and changes
the status to "Shooting".
When the shooting sound is done playing, change the status back to "Ready".
While the laser is "Ready", pressing the Power Down button plays the power down sound
and changes the status to "Discharging".
When the power down sound finishes playing, change the status to "Off".
While the laser is "Charging", "Discharging", or "Shooting", none of the buttons do anything.
Hint: You should use a couple of extra Boolean variables to keep track of when the laser is charged and
when the laser is busy doing something.
CODE IN PYTHON PLEASE
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago