Lab 11: Images and Sounds

Table of Contents


  • Get you ready for the project.
  • Introduce or review the following concepts:
    • Creating images
    • Changing images dynamically (review)
    • Image file formats
    • RGBA color model (review)
    • Transparency (review)
    • Creating sounds
    • Sound formats
    • Sound quality parameters
    • Handling mouse input (review)

Academic Honesty

Read the Scholastic Honesty Policy and Quest and Lab Integrity policies of the syllabus. Here are some clarifications for this particular lab:

  • This is a solo lab that you must complete your self but with some guild elements.
  • You may discuss the code with other students for this lab.
  • You must type all the code yourself and not copy from another student or source.
  • You may get sound files and images from other guild members.

Lab Specifications

  1. Make sure you have completed the exercises from lesson 10 and lesson 11 as they are submitted as part of this lab.
  2. Complete the Chapter 9 exercises in CodeLab. These are review exercises and you have all the information needed to complete them. If you have questions, please contact the instructor for help.
  3. Scan the textbook chapter 10 to get an overview of the material.
  4. Complete the in-chapter exercises 10.1 through 10.34 that are listed throughout chapter 10.

    You can download the starting files from: Book scenarios.

  5. Read the textbook as you progress through the chapter to enhance your understanding and follow the exercise steps exactly except for the following changes:
    1. Exercise 10.1: name the scenario "my-test" (without the quotes).
    2. Exercise 10.13: use another sound file if you do not have access to a microphone.
    3. Exercise 10.14: use any type of actor to make the sound when clicked.
    4. Exercise 10.15: send each guild member your picture and a recording of you saying something. Compile the images and sounds from at least two guild members, in addition to yourself, into your scenario.
    5. Exercise 10.16-19: optional
    6. Exercise 10.21: modify the code for both of your actor classes for step 10.14 and 10.15 to produce two sounds.

      A sound effect in a game is any sound. You do not need product any special effect for this exercise though you may if desired.

    7. Exercises 10.23-24: optional
    8. Exercises 10.28-31: If you do not have image processing software search for free image manipulation programs
    9. Exercise 10.34: as a hint, see how the image change was made in the exercise for 7.2.6.
    10. For those exercises steps that have a text answer, put the text in the README.TXT file for the scenario (Scenario > Scenario Information). The README.TXT is automatically turned in as part of the scenario. For example:
      Exercises with Text Answers
      10.7: mousePressed, mouseClicked, mouseDragged, mouseDragEnded, mouseMoved, getMouseInfo
      (answer needed for 10.7, 10.8, 10.25, 10.28, 10.30, 10.31, 10.35)
  6. Upload the completed "my-test" scenario to Canvas as explained in the section of this document: Deliverables.

Grading Criteria

The instructor will evaluate your lab using the following criteria. Thus you should check your lab against these criteria to maximize your XP.

Lesson Exercises (from Class)

  • 2: All lesson exercises attempted and turned in
  • 1: Some lesson exercises not completed and turned in or other problems found
  • 0: No lesson exercises turned in or wrong folder name

Tutorial Lab (Textbook)

  • 4: Demonstrates mastery of the lab exercise:
    • Applies concepts from the lessons appropriately
    • Follows the steps exactly
    • Exercises perform correctly
  • 3: Has all the major functionality expected:
    • Demonstrates many techniques from the lesson
    • May deviate from the specified steps in some way
    • Implementation seems more complicated than necessary.
  • 2: Has much of the functionality expected:
    • Demonstrates some techniques from the lesson
    • Deviates from the specified steps in some way
    • Implementation seems excessively complicated.
  • 1: Serious functional problems but shows some effort and understanding:
    • Follows at least 1/2 of the of the specified steps
    • Has a major error (detected by the browser) or many minor errors
    • Demonstrates few techniques from the lesson
  • 0: Not turned in or wrong folder name

CodeLab Exercises

Number completed correctly / number exercises * 8 and rounded up to the nearest integer.

Maximum XP: 14


The CodeLab due today is submitted automatically, but other lab work must be submitted as described below.

  1. On your computer, create a folder for the lesson exercises named "lesson" (no extra characters) and place all the exercise files from lesson 10 into this folder. There should be one scenario in the folder, asteroids-2b, which is the culmination of the lesson exercises completed during lesson 10.
  2. Create a second folder named "tutorial" (no extra characters) and place the scenarios from this lab into the folder. Do not include any files from previous labs. There should be one to three scenarios in this folder:
    1. my-test starting with exercise 10.1
    2. color-test starting with exercise 10.36 (optional)
    3. smoke starting with exercise 10.39 (optional)
  3. Create a zip file containing both folders, "lesson" and "tutorial", and submit the zip file to the Lab 11 slot of Canvas.

If you have any questions or find an error in the above files lists, contact the instructor right away.

Please do not add any extra characters to the above folder names. Also, do not put any spaces or special characters like #, : or $ in zip file or folder names.

Your crafted code must work as submitted. Remember to test and double check your files before and after submitting them. If you make a mistake, you can resubmit up to the deadline but must resubmit all your quest files.

Last Updated: April 30 2020 @18:49:27