1. Introduction to a Graphical User Interface

1.1. Zombie Quiz Show

  • It is a game with different options.

  • Option 1 is for the correct answer and Option 2 is for the incorrect answer.

  • The program will have a sound effect for each answer.

  • The program must keep track of how many correct and incorrect answers there were.

  • Finally, press 0 to finish.

1.2. Playing Audio

  • Let’s start by creating the logic for playing audio.

  • There are various ways to do this; one option might be to use the pygame library, among others.

  • Again, we will use the Brython module.

  • The code below generates an HTML element called audio.

  • On this page, you can obtain free sounds that you can use in the program.
    • You just need to copy and paste the url of the sound you like.

  • You noticed that the audio element with controls to play and stop it was created.

  • You can add as many sounds as you want.

  • But how do I handle when the sound is played and stopped through the program?
    • Let’s link events to achieve it.

  • The sounds are playing very well.

  • Now that audio is working, let’s create the Zombie Quiz Show!

You have attempted of activities on this page