CS105L Introduction to Game Programming Using Alice (Lab)
Fall 2009

Lab Mid-Tern Exam

Directions:
You must submit a single Alice file. The file must be named "midterm-last-first.a2w", where first/last refer to your own first and last name. You may refer to your own labs files on your computer.

WebCt:
http://www.uab.edu/it/instech/blackboard/a_login.html

Honor Statement:
By turning in your quiz, you confirm that all of the work is your own. That is, you did not take your answer and adapt it from someone else, or get detailed advice from another student on how they answered a question. You also cannot give away your answers to another student. If you use any code found on the Internet or some other computer, you must inform us about your reuse of such code. You agree, by submitting this quiz, that this is your own work.

The exam will consist of one Alice animation built in three parts. The first time you use a variable add a comment identifying its type (local, global, class) and why you chose that type. Your code should be well constructed with appropriate modularization. Your code should be well commented. "Additional Details" are required elements of your code.

  1. Scene: Construct a scene with a Magician standing behind a table. Place a bunny on the table. Have the magician greet the user suitably, i.e. say something to the user. Have the magician introduce the bunny. Then have the bunny say, "Watch this!" Then, make the bunny disappear (via opacity), move the bunny on the magician's hat, make the bunny reappear and jump up and down on the hat.

    Additional Details: Set a property of an object. Use a built in method.

  2. Scene: Continued after step 1 above. Have the magician express consternation with his wayward assistant. Then have him say, "Now for a trick... Shazzam!" Make the magician disappear, then make the bunny fall to the ground and say, "Ouch! It's on now, magic man." Make the bunny move to the table and destroy it appropriately. Have the bunny get a number from the user. Store this number as a class-level property "bunnyPower". Resize the bunny to "bunnyPower" amount and have him announce each power level from 1 to bunnyPower while the bunny increases in size (e.g. "Power 1!" "Power 2!" etc.).

    Additional Details: Create a class-level property bunnyPower. Create a powerUp method to perform the resize of the bunny and do the announcing of power levels. Use a loop construction. Use a Do-together block. Use Number-to-String conversion and String-Concatenation when announcing power level.

  3. Scene: Continued from above. Have the magician reappear and say, "Ok, fuzzball, let's do this thing!" Have him ask the user for his power level, to be stored in a property or variable. The one with the greatest power level should win the epic battle which follows. If they have the same power level, the two should call a truce.

    Additional Details: Use an If/else construct. Use combination logic in the If/else condition.

If you have time left over, presentation (camera work, animations, epicness, etc.) counts for bonus!




Last modified: 10/12/09
By: David O'Gwynn