Homework‎ > ‎

Assignment 4

Posted: Sat. Sep. 17, 2011
Due: End of day on Thu. Sep. 22, 2011 

Task 1: Reading

Read Chapters 3, 5, 17, and 18 of Wolber.  

For this task, you should create an Assignment 4 page in your portfolio and list the most important concepts you learned from the reading.  

You should also create a list of any questions you have after reading these chapters. What are things that you didn't understand or wish you understood better? 

Task 2: Noink

In this problem, you will create from scratch a simple game we'll call Noink (rhymes with "oink"). 

Begin by downloading a working Noink  app via the following barcode. 

Play Noink to understand the behavior of the game. Observe that paddle moves only horizontally, but that you can control its horizontal position by touching or dragging your finger anywhere on the canvas. 

Your task is to use App Inventor to create an app named YourNameNoink that looks and behaves exactly like the Noink game you downloaded.  

On your Assignment 4 page, document your game creation process. Describe the order in which you created components and programmed behaviors.  Focus on issues you encountered and how you resolved those issues. Discuss any behaviors that don't quite work in your final version. 

When you're done, upload a .zip file for your game to your Assignment 4 page. 

  • This game has lots of components and behaviors. Don't try to implement everything at once!  Follow the design/coding principles in Wolber Ch. 15.  In particular, build and test your app in small increments.

    For example, you might first create a bouncing ball. Then create a paddle that moves with your finger, but does not interact with the ball. Then get the ball to hit and miss the paddle. Then add hit and miss labels at the top of the screen that count the hits and misses. And so on. 

  • The paddle is just a sprite with a black rectangle image (attached to this assignment).

  • The three sound files you need are attached to this assignment. 

  • The canvas is 300 pixels wide x 320 pixels high.

  • The game goes to the next level whenever the Hits counter reaches a number even divisible by 10.  Use the remainder block to determine this. 

  • The initial paddle size is 75 x 30.  The paddle width decreases by 5 every time the level is incremented, except that the width should never get smaller than 5.  Make sure the Rotates flag of your paddle image sprite is unchecked in the Properties pane of the Designer window. For some reason, the paddle width won't change when the Rotates flag is set. 

  • The top left corner of the paddle should always be at y-coordinate 260. The horizontal position of the paddle is controlled by touching or dragging your finger anywhere on the canvas. This should set the center of the paddle to be the x-coordinate where you touched or dragged your finger

  • The ball interval should be 50 millseconds, and should not change during the game.

  • The initial ball radius is 30. The ball radius decreases by 2 every time the level is incremented, except that the radius should never get smaller than 2.

  • At the start of every level, the initial ball speed should be twice the level number.  This speed should increase by 2 units every time the ball hits the paddle. 

  • To determine when the ball will bounce and to distinguish when the ball hits or misses the paddle, you will need to use the encoding of edges described on p. 254 of Wolber.

  • When the ball misses the paddle, it should be moved to a random location at the top of the canvas and its heading should be set to a random value between 225 and 315 degrees. Its speed should not change in this situation. 

  • Use procedures to avoid duplicating code. (You needn't create procedures that take parameters.) For examples of procedures, see the BouncerGame solutions from Lecture 5 and the MoleMash and LadybugChase apps from the textbook.

  • Use global variables to hold "magic constants" like the initial paddle width, the amount to decrement the paddle width each time the level is incremented, etc.  See the BouncerGame solutions for examples. 

  • Be sure to test behavior for high levels like 15 and 16. Rather than playing the game to reach this level, you can temporarily set properties to be what they should be for these levels.
  • If you are unclear about certain aspects of Noink behavior, post a question on piazza.com!
Task 3: Improving Noink

Soon you'll be designing and implementing your own Android game app. So it's a good idea to start thinking about what makes games fun and how to improve existing games. 

Describe modifications to Noink that you think would make it more fun to play. You can change the rules/behavior of the game, add new components, etc. 

You do not have to program any of your suggested modifications. But if you have time and would like to do so, you can create an app named YourNameNoinkModified that implements some of your suggestions.  Attach the .zip for this application to your Assignment 4 page. 
Lyng Turbak,
Sep 17, 2011, 8:48 AM
Lyng Turbak,
Sep 17, 2011, 8:57 AM
Lyng Turbak,
Sep 17, 2011, 8:48 AM
Lyng Turbak,
Sep 17, 2011, 8:48 AM
Lyng Turbak,
Sep 17, 2011, 8:46 AM